In HTML standard, SPANs are not allowed to cross Paragraphs.
In Vav4.0, SPAN tags go thour paragraphs and other block-level elements, except tbles.
It be compatable with Nav4.0 and HTML standard, HTMLParser close all SPANs before open a new paragraph, and reopen SPANs inside the new paragraph
Text ater the color=red SPAN is opend.

Text in a new paragraph.

Text after the new paragrapg is closed, still in color=red SPAN.
Text ater the color=red SPAN is closed.