Last modified: 2013-06-11 23:29:18 UTC
We now mark TreeBuilder- and QuoteTransformer-closed elements with the autoInsertedEnd flag in data-parsoid. The serializer then omits those end tags from serialization. Currently the serializer does this unconditionally, even if the auto-closing context has changed as in this example: {| | ''italic |} The DOM produced includes an </i> tag. An editor can append content to the table cell after the italic content, which would then wrongly be included in the italic element after serialization: {| | ''italic new non-italic content |} The serializer needs to be smarter about these context changes, and should emit the close tag when needed. In this case, the correct result would be: {| | ''italic'' new non-italic content |}
We have pretty much solved this with two changes: * Selective serialization is finer-grained based on our own DOM diff. This hides diffs from auto-inserted end tags in unmodified content. * Auto-inserted end tag markers are only used in round-trip testing, where doing so is safe. This means that auto-inserted end tags are explicitly serialized when that part of the content was modified. Since this tends to be local the diff will still be readable.