jenkins-bot has submitted this change and it was merged.

Change subject: Fix bug in foster parented content detection
......................................................................


Fix bug in foster parented content detection

Introduced in 7bd2df748b013d17971427e953b23a53356a982c.

nextSibling was null for text nodes after wrapping in span, ending the
walk. Adds a test case to ensure subsequent nodes are wrapped.

Change-Id: Ie61ddc5f78e9b62af9441a965e8e66e4b19789d4
---
M js/lib/dom.markFosteredContent.js
M js/tests/parserTests.txt
2 files changed, 14 insertions(+), 0 deletions(-)

Approvals:
  GWicke: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/js/lib/dom.markFosteredContent.js 
b/js/lib/dom.markFosteredContent.js
index 55676ad..43ad705 100644
--- a/js/lib/dom.markFosteredContent.js
+++ b/js/lib/dom.markFosteredContent.js
@@ -29,6 +29,7 @@
                                        span.data = { parsoid: { fostered: true 
} };
                                        sibling.parentNode.insertBefore( span, 
sibling );
                                        span.appendChild( sibling );
+                                       sibling = span;
                                }
                                sibling = sibling.nextSibling;
                        }
diff --git a/js/tests/parserTests.txt b/js/tests/parserTests.txt
index 7c664ba..6cae8c7 100644
--- a/js/tests/parserTests.txt
+++ b/js/tests/parserTests.txt
@@ -17329,6 +17329,19 @@
 plain text
 !!end
 
+!!test
+Ensure fostered text content is wrapped in spans
+!!options
+parsoid=wt2html
+!!input
+<table>hi</table><table>ho</table>
+!!result
+<span>hi</span>
+<table></table>
+<span>ho</span>
+<table></table>
+!!end
+
 # -----------------------------------------------------------------
 # The following section of tests are primarily to spec requirements
 # around serialization of new/edited content.

-- 
To view, visit https://gerrit.wikimedia.org/r/81166
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie61ddc5f78e9b62af9441a965e8e66e4b19789d4
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to