Menu

#293 String bean <p> tag at text start is handled incorrectly.

open
5
2012-03-01
2012-03-01
plad
No

Using StringBean, <p> at the beginning of the text is handled incorrectly.
Parsing:
<html>1<p>2</p></html>

will result in the text
12

while it should be
"1\n2"

(parsing <html>13<p>2</p></html> will return "13\n2".

This is a bug in the carriageReturn function:

if ((0 != length) // don't append newlines to the beginning of a buffer
&& ((NEWLINE_SIZE <= length) // not enough chars to hold a NEWLINE
&& (!mBuffer.substring (
length - NEWLINE_SIZE, length).equals (NEWLINE))))
should be true if 0 < length < NEWLIBE_SIZE

Discussion


Log in to post a comment.