Skip to content

Commit 099329f

Browse files
committed
roffit: consider .IP a list of comma separated names
Add `<a name>` targets for each one of them in the output. Works excellent for curl's manpage options for example. Call this version 0.17
1 parent 42e56ad commit 099329f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

roffit

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#
2222
# Web: https://daniel.haxx.se/projects/roffit
2323

24-
my $version = "0.16";
24+
my $version = "0.17";
2525

2626
use strict;
2727
#use warnings;
@@ -468,15 +468,19 @@ sub parsefile {
468468
showp(@p);
469469
@p="";
470470

471-
my $name= text2name($rest);
472-
$anchor{$name}=1;
473-
471+
# there might be a comma separated list of items
472+
my @comma = split(/,/, $rest);
473+
for my $r (@comma) {
474+
my $name= text2name($r);
475+
$anchor{$name}=1;
476+
push @p, "<a name=\"$name\"></a>";
477+
}
474478
$rest =~ s/\"//g; # cut off quotes
475479
$rest =~ s/\\f[IBPR]//g; # Un-format it (Use CSS on nroffip class instead)
476480
$rest = do_encode($rest);
477481

478482
$indentlevel-- if ($indentlevel);
479-
push @p, "<a name=\"$name\"></a><span class=\"nroffip\">$rest</span> ";
483+
push @p, "<span class=\"nroffip\">$rest</span> ";
480484
# make this a single-line title
481485
showp(@p);
482486
@p="";

0 commit comments

Comments
 (0)