Encode remaining newlines at the end of the text.
This commit is contained in:
parent
f8123e7934
commit
2fea02fb46
1 changed files with 7 additions and 1 deletions
|
@ -452,7 +452,7 @@ public final class HtmlEncoder {
|
||||||
if (!insidePreTag && linebreaks > swallowLinebreaks) {
|
if (!insidePreTag && linebreaks > swallowLinebreaks) {
|
||||||
linebreaks -= swallowLinebreaks;
|
linebreaks -= swallowLinebreaks;
|
||||||
for (int k=0; k<linebreaks; k++)
|
for (int k=0; k<linebreaks; k++)
|
||||||
ret.append ("\n<br />");
|
ret.append ("<br />\n");
|
||||||
}
|
}
|
||||||
if (!insideTag)
|
if (!insideTag)
|
||||||
swallowLinebreaks = 0;
|
swallowLinebreaks = 0;
|
||||||
|
@ -573,6 +573,12 @@ public final class HtmlEncoder {
|
||||||
ret.append (">");
|
ret.append (">");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// add remaining newlines we may have collected
|
||||||
|
if (linebreaks > 0 && linebreaks > swallowLinebreaks) {
|
||||||
|
linebreaks -= swallowLinebreaks;
|
||||||
|
for (int i=0; i<linebreaks; i++)
|
||||||
|
ret.append ("<br />\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue