Last modified: 2012-10-29 18:09:40 UTC
Created attachment 9676 [details] screenshot Like <b>this <a>example</b></a>. See attachment.
This is a known issue with es.HtmlSerializer - unlike the es.ContentView.getHtml method, es.HtmlSerializer doesn't automatically handle nesting problems.
A quick trick to fix this might be setting .innerHTML of a hidden element to the new source, and then reading the .innerHTML back. The browser's HTML parser will fix up the nesting according to the HTML spec while parsing the fragment.
While es.ContentView.getHtml handles nesting just fine, the approach you are suggestion may be higher performance than the lengths that getHtml has to go through to produce correct HTML. We need to make sure this is reliable across browsers however, and I suspect IE will choke and die.
The parser pipeline uses a JS HTML5 tree builder for nesting fix-ups with standardized behavior, which ought to be identical to the innerHTML method on HTML5-compliant browsers. This tree builder could serve as a pure-JS fall-back for browsers with non-standard parsers if we should standardize on the HTML5 flavor of nesting fix-ups.
Now resolved in new version of Visual Editor.
Mass-moving old VisualEditor tickets to the VE product. Search for this message to mass-delete bugmail.
Noting bugs closed in the 2012-10-15 release.