jenkins-bot has submitted this change and it was merged.
Change subject: Bug 56489: Allow content attribute on parsoid-generated meta
tokens
......................................................................
Bug 56489: Allow content attribute on parsoid-generated meta tokens
Change-Id: I3280c61225ccfab072248f305ebc7bf743f0f61a
---
M js/lib/ext.core.Sanitizer.js
M js/tests/parserTests.txt
2 files changed, 14 insertions(+), 3 deletions(-)
Approvals:
Subramanya Sastry: Looks good to me, approved
jenkins-bot: Verified
diff --git a/js/lib/ext.core.Sanitizer.js b/js/lib/ext.core.Sanitizer.js
index d8c2abc..28d3a76 100644
--- a/js/lib/ext.core.Sanitizer.js
+++ b/js/lib/ext.core.Sanitizer.js
@@ -909,7 +909,7 @@
// SSS FIXME: There is a test in mediawiki.environment.js that doles out
// and tests about ids. There are probably some tests in mediawiki.Util.js
// as well. We should move all these kind of tests somewhere else.
-Sanitizer.prototype.isParsoidAttr = function(k, v) {
+Sanitizer.prototype.isParsoidAttr = function(k, v, attrs) {
// NOTES:
// 1. Currently the tokenizer unconditionally escapes typeof and about
// attributes from wikitxt to data-x-typeof and data-x-about. So,
@@ -922,7 +922,8 @@
// That further processing will catch and discard any dangerous
// strings in the rest of the attribute
return (/^(?:typeof|property|rel)$/).test(k) &&
/(?:^|\s)mw:.+?(?=$|\s)/.test(v) ||
- k === "about" && /^#mwt\d+$/.test(v);
+ k === "about" && /^#mwt\d+$/.test(v) ||
+ k === "content" &&
/(?:^|\s)mw:.+?(?=$|\s)/.test(Util.lookup(attrs, 'property'));
};
Sanitizer.prototype.sanitizeTagAttrs = function(newToken, attrs) {
@@ -943,7 +944,7 @@
origK = a.ksrc || k,
v = a.v,
origV = a.vsrc || v,
- psdAttr = this.isParsoidAttr(k, v);
+ psdAttr = this.isParsoidAttr(k, v, attrs);
//console.warn('k = ' + k + '; v = ' + v);
diff --git a/js/tests/parserTests.txt b/js/tests/parserTests.txt
index c718512..6a17898 100644
--- a/js/tests/parserTests.txt
+++ b/js/tests/parserTests.txt
@@ -10132,6 +10132,16 @@
<link rel="mw:PageProp/Category" href="Category:Foo#Bar">
!! end
+!! test
+Parsoid: Defaultsort
+!! options
+parsoid
+!! input
+{{DEFAULTSORT:Foo}}
+!! result
+<meta property="mw:PageProp/categorydefaultsort" content="Foo"/>
+!! end
+
###
### Inter-language links
###
--
To view, visit https://gerrit.wikimedia.org/r/93108
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3280c61225ccfab072248f305ebc7bf743f0f61a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: GWicke <[email protected]>
Gerrit-Reviewer: Catrope <[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