Magnus Manske wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Answering myself, I have now a class variable to determine how to handle these cases. If it is set to "don't tolerate", it inserts
<error type="heading" reason="trailing blank"/>
This is a bit similar to my output. Given input such as:
==heading text== mess blah blah
I output:
<heading-line> <heading level="2"> heading text </heading> <wikiwyg:syntax-error type="extra content"> mess </wikiwyg:syntax-error> </heading-line> <paragraph> blah blah </paragraph>
This is designed to try to capture what the user wanted to do. This could be corrected by appending the content of the syntax-error onto the next heading, or the presenter could ignore the error or highlight it. Eitherway the problem is kept pretty local and nothing much is missing from the page.
Trailing space is just a special case in which the syntax-error tag would contain a text node with just whitespace.
My corrector changes the XML to this:
<heading level="2"> heading text </heading> <paragraph> wikiwyg:syntax-correction blah blah </wikiwyg:syntax-correction> </paragraph>
And then the presenter treats syntax-correction as DOM DocumentFragments.
-- Jim