GWicke has submitted this change and it was merged.
Change subject: More accurate detection of auto-inserted end-tags.
......................................................................
More accurate detection of auto-inserted end-tags.
* Consider this test case (extracted from
en/Bolton Wanderers F.C. season 2008-09)
---------------------
{{Fb_kit_header |su=[[Reebok]] |sp=[[Reebok]]}}
{| style="border: 0px;"
|foo
|}
---------------------
Fb_kit_header opens a table which is not closed before
a new table is opened. So, the tree builder auto-closes the
open table. Since this table was opened in a template, the
previous code didn't run builder-inserted-tag-detection on
the table tag even though the end tag was closed outside the
template. This then threw DSR algorithm for a loop which
assumed that the table came from the top-level and caused
an off-by-2 error ("|}") which the affected RT-ing.
* This patch figures out when an end-tag comes from top-level
content (even if the open-tag comes from a template) and
runs builder-inserted-tag-detection on the end-tag which
fixes RTing of this snippet (and the page from which this
snippet was extracted).
* No change in parser tests (TODO: add new parser tests).
Change-Id: I853b2fd3ebdbf593540ef809f9176d2a7f0fb8b1
---
M js/lib/mediawiki.DOMPostProcessor.js
M js/lib/mediawiki.DOMUtils.js
2 files changed, 85 insertions(+), 34 deletions(-)
Approvals:
GWicke: Verified; Looks good to me, approved
jenkins-bot: Checked
--
To view, visit https://gerrit.wikimedia.org/r/44159
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I853b2fd3ebdbf593540ef809f9176d2a7f0fb8b1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits