LUCENE-1610: fix changes-to-html to properly format <code>...</code>

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@768427 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2009-04-24 22:21:38 +00:00
parent ce0113725e
commit 65fd24fbc4
1 changed files with 5 additions and 3 deletions

View File

@ -383,9 +383,11 @@ for my $rel (@releases) {
for my $itemnum (1..$#{$items}) { for my $itemnum (1..$#{$items}) {
my $item = $items->[$itemnum]; my $item = $items->[$itemnum];
$item =~ s:&:&amp;:g; # Escape HTML metachars $item =~ s:&:&amp;:g; # Escape HTML metachars,
$item =~ s:<:&lt;:g; $item =~ s:<(?!/?code>):&lt;:gi; # but leave <code> tags intact
$item =~ s:>:&gt;:g; $item =~ s:(?<!code)>:&gt;:gi; # and add <pre> tags so that
$item =~ s:<code>:<code><pre>:gi; # whitespace is preserved in the
$item =~ s:</code>:</pre></code>:gi; # output.
# Put attributions on their own lines. # Put attributions on their own lines.
# Check for trailing parenthesized attribution with no following period. # Check for trailing parenthesized attribution with no following period.