($tag, $which_head, $otitle) = ($1,$2,$3);
my $title = depod( $otitle );
- my $name = htmlify( $title );
+ my $name = anchorify( $title );
$$sections{$name} = 1;
- $name =~ s/\s/_/g; # htmlify keeps spaces but we don't want them here..
$title = process_text( \$otitle );
while ($which_head != $listdepth) {
my $any = "${ltrs}${gunk}${punc}";
$rest =~ s{
- \b # start at word boundary
- ( # begin $1 {
- $urls : # need resource and a colon
- (?!:) # Ignore File::, among others.
- [$any] +? # followed by one or more of any valid
- # character, but be conservative and
- # take only what you need to....
- ) # end $1 }
- (?= # look-ahead non-consumptive assertion
- [$punc]* # either 0 or more punctuation
- (?: # followed
- [^$any] # by a non-url char
- | # or
- $ # end of the string
- ) #
- | # or else
- $ # then end of the string
+ \b # start at word boundary
+ ( # begin $1 {
+ $urls : # need resource and a colon
+ (?!:) # Ignore File::, among others.
+ [$any] +? # followed by one or more of any valid
+ # character, but be conservative and
+ # take only what you need to....
+ ) # end $1 }
+ (?=
+ " > # maybe pre-quoted '<a href="...">'
+ | # or:
+ [$punc]* # 0 or more punctuation
+ (?: # followed
+ [^$any] # by a non-url char
+ | # or
+ $ # end of the string
+ ) #
+ | # or else
+ $ # then end of the string
)
}{<a href="$1">$1</a>}igox;
if( exists $pages{$page} and $pages{$page} =~ /([^:.]*)\.[^:]*:/){
$page = $1 . '.html';
}
- my $link = "$htmlroot/$page#item_$fid";
+ my $link = "$htmlroot/$page#item_" . anchorify($fid);
# Here, we take advantage of the knowledge that $htmlfileurl
# ne '' implies $htmlroot eq ''.
$url = $link ;
}
} else {
- $url = "#item_" . $fid;
+ $url = "#item_" . anchorify($fid);
}
confess "url has space: $url" if $url =~ /"[^"]*\s[^"]*"/;