Last modified: 2013-06-11 23:29:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44248, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42248 - Only omit auto-closed end tags from serialization if auto-closing context is unchanged
Only omit auto-closed end tags from serialization if auto-closing context is ...
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
serializer (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: ssastry
:
Depends on:
Blocks: 39567
  Show dependency treegraph
 
Reported: 2012-11-18 23:42 UTC by Gabriel Wicke
Modified: 2013-06-11 23:29 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gabriel Wicke 2012-11-18 23:42:56 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
|}
Comment 1 Gabriel Wicke 2013-06-11 23:29:18 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links