X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FPod%2FHtml.pm;h=e8f9ff3fa5be47a609dc0a83a88edb243d2cdb56;hb=e69a2255d0db4d110e403864fcb97407ce8e4ff9;hp=1ae81c9e60ac2390023f436f08283e4d8c1b7abd;hpb=be0036e4fe8f594c35442537fa361e9306bb2431;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Pod/Html.pm b/lib/Pod/Html.pm index 1ae81c9..e8f9ff3 100644 --- a/lib/Pod/Html.pm +++ b/lib/Pod/Html.pm @@ -369,6 +369,25 @@ sub pod2html { $/ = ""; my @poddata = ; close(POD); + + # be eol agnostic + for (@poddata) { + 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/\r/\n/g; + /\n\n/ ? + map { "$_\n\n" } split /\n\n/ : + $_ } @poddata; + } + last; + } + } + clean_data( \@poddata ); # scan the pod for =head[1-6] directives and build an index @@ -1255,9 +1274,9 @@ sub process_pre { $rest = $$text; # insert spaces in place of tabs - $rest =~ s#.*# - my $line = $&; - 1 while $line =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e; + $rest =~ s#(.+)# + my $line = $1; + 1 while $line =~ s/(\t+)/' ' x ((length($1) * 8) - $-[0] % 8)/e; $line; #eg; @@ -1694,7 +1713,8 @@ sub html_escape { $rest =~ s//>/g; $rest =~ s/"/"/g; - $rest =~ s/'/'/g; + # ' is only in XHTML, not HTML4. Be conservative + #$rest =~ s/'/'/g; return $rest; }