savepublishing icon indicating copy to clipboard operation
savepublishing copied to clipboard

Parse error: http://english.alarabiya.net/articles/2012/12/31/257960.html

Open ftrain opened this issue 13 years ago • 1 comments

Seems to cut half the text. Safari mobile ios6.

ftrain avatar Dec 31 '12 21:12 ftrain

This one was kinda interesting. The paragraphs are separated with double
s, all within one P node. During processing SP converts those br tags to BR, but there's no space between the period at the end of a paragraph and the br tag. Also the first few paragraphs are single sentences, and the \w in javascript includes the underscore character.

So knowing all that, nextIsText almost always evaluated to true because after the first few periods there was BR right away. Changing that test to [^\s_] instead of \w seems to work. So it'll consider anything that isn't a space or an underscore to be "continuing text" instead of signaling the end of the statement.

kuro5hin avatar Jan 11 '13 19:01 kuro5hin