mirror of
https://github.com/troydm/exp.git
synced 2025-05-20 08:20:11 -07:00
formatting added
This commit is contained in:
parent
b03b1ef5c4
commit
f806c06cb8
11
exp
11
exp
@ -70,6 +70,15 @@ sub parsetag {
|
|||||||
return ();
|
return ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub formatdesc {
|
||||||
|
my ($t,$d) = (@_);
|
||||||
|
if($d =~ /\n/){
|
||||||
|
my $offset = ' ' x (length($t)+6);
|
||||||
|
$d =~ s/\n\s*/\n$offset/g;
|
||||||
|
}
|
||||||
|
return $d;
|
||||||
|
}
|
||||||
|
|
||||||
my @helprefs = $content =~ /helpref=\"help-(\d+)\"/g;
|
my @helprefs = $content =~ /helpref=\"help-(\d+)\"/g;
|
||||||
|
|
||||||
for my $i (@helprefs){
|
for my $i (@helprefs){
|
||||||
@ -77,7 +86,7 @@ for my $i (@helprefs){
|
|||||||
my @d = parsetag("pre","help-$i");
|
my @d = parsetag("pre","help-$i");
|
||||||
if(@t){
|
if(@t){
|
||||||
my $title = decodechars(striptags $t[1]) if @t;
|
my $title = decodechars(striptags $t[1]) if @t;
|
||||||
my $desc = decodechars(striptags $d[1]) if @d;
|
my $desc = formatdesc($title, decodechars(striptags $d[1])) if @d;
|
||||||
if($color){
|
if($color){
|
||||||
print "\n", $title, color($color), " ---[", color("reset")
|
print "\n", $title, color($color), " ---[", color("reset")
|
||||||
, " $desc ", color($color), "]", color("reset"), "\n\n";
|
, " $desc ", color($color), "]", color("reset"), "\n\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user