jenkins-bot has submitted this change and it was merged.
Change subject: Escape data-mw as well as data-parsoid in tokenizer.
......................................................................
Escape data-mw as well as data-parsoid in tokenizer.
Change-Id: I0b5c99baa2c3a0d8766a40bf0f2428ccc93c4455
---
M lib/pegTokenizer.pegjs.txt
M tests/parserTests.txt
2 files changed, 3 insertions(+), 3 deletions(-)
Approvals:
Arlolra: Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/pegTokenizer.pegjs.txt b/lib/pegTokenizer.pegjs.txt
index 938fb25..ffa3e37 100644
--- a/lib/pegTokenizer.pegjs.txt
+++ b/lib/pegTokenizer.pegjs.txt
@@ -1250,7 +1250,7 @@
// Encapsulate protected attributes.
if ( typeof name === "string" ) {
name = name.replace(
- /^(about|data-parsoid.*|data-x.*|property|rel|typeof)$/i,
+ /^(about|data-mw.*|data-parsoid.*|data-x.*|property|rel|typeof)$/i,
"data-x-$1" );
}
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index a4a2e34..55187a9 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -23394,9 +23394,9 @@
!!test
Encapsulate protected attributes from wt
!! wikitext
-<div typeof="mw:placeholder stuff" data-parsoid="weird"
data-parsoid-other="no" about="time" rel="mw:true">foo</div>
+<div typeof="mw:placeholder stuff" data-mw="whoo" data-parsoid="weird"
data-parsoid-other="no" about="time" rel="mw:true">foo</div>
!! html/parsoid
-<body><div data-x-typeof="mw:placeholder stuff" data-x-data-parsoid="weird"
data-x-data-parsoid-other="no" data-x-about="time"
data-x-rel="mw:true">foo</div>
+<body><div data-x-typeof="mw:placeholder stuff" data-x-data-mw="whoo"
data-x-data-parsoid="weird" data-x-data-parsoid-other="no" data-x-about="time"
data-x-rel="mw:true">foo</div>
</body>
!!end
--
To view, visit https://gerrit.wikimedia.org/r/224187
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0b5c99baa2c3a0d8766a40bf0f2428ccc93c4455
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits