X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FPod%2FHtml.pm;h=61152afef344f88710464851feb33ded9e8d4845;hb=4f7806f3e19db049970d6c6265e5b956d1d7f74a;hp=515ca4ebe9ded111b6a06f4a14344f1ec782d370;hpb=bbed45f69afd2733a47fb6f98dde2d952fd14e1e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Pod/Html.pm b/lib/Pod/Html.pm index 515ca4e..61152af 100644 --- a/lib/Pod/Html.pm +++ b/lib/Pod/Html.pm @@ -372,14 +372,14 @@ sub pod2html { # be eol agnostic for (@poddata) { - if (/\x0D/) { - if (/\x0D\x0A/) { - @poddata = map { s/\x0D\x0A/\n/g; + if (/\r/) { + if (/\r\n/) { + @poddata = map { s/\r\n/\n/g; /\n\n/ ? map { "$_\n\n" } split /\n\n/ : $_ } @poddata; } else { - @poddata = map { s/\x0D/\n/g; + @poddata = map { s/\r/\n/g; /\n\n/ ? map { "$_\n\n" } split /\n\n/ : $_ } @poddata; @@ -980,9 +980,8 @@ sub scan_headings { ($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) { @@ -1337,23 +1336,25 @@ sub process_pre { 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 '' + | # 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 ) }{$1}igox; @@ -1903,7 +1904,7 @@ sub coderef($$){ 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 ''. @@ -1914,7 +1915,7 @@ sub coderef($$){ $url = $link ; } } else { - $url = "#item_" . $fid; + $url = "#item_" . anchorify($fid); } confess "url has space: $url" if $url =~ /"[^"]*\s[^"]*"/;