[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Strip everything before the first pf token

2018-01-24 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/406057 )

Change subject: Strip everything before the first pf token
..


Strip everything before the first pf token

In this isolate case,
{{safesubst:#if:{{{1}
only "subst:" is part of the same token as the prefix so
`normalizeTarget` doesn't take care of remove the "safesubst:"

The fix here is from noting that we wouldn't be at this place in the
code if the target didn't normalize a canonical function name, so the
contents before the prefix can be safely discarded.

This is another patch along the line of 5608e83 and bcd5572

Bug: T185643
Change-Id: I7002804fcf5305ffb6c88d93c201d9e972f9037f
---
M lib/wt2html/tt/TemplateHandler.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/lib/wt2html/tt/TemplateHandler.js 
b/lib/wt2html/tt/TemplateHandler.js
index bd00531..33968e4 100644
--- a/lib/wt2html/tt/TemplateHandler.js
+++ b/lib/wt2html/tt/TemplateHandler.js
@@ -473,7 +473,7 @@
if (canonicalFunctionName !== undefined) {
// Extract toks that make up pfArg
var pfArgToks;
-   var re = new RegExp(prefix, 'i');
+   var re = new RegExp('^(.*?)' + prefix, 'i');
 
// Because of the lenient stringifying above, we need to find 
the prefix
var i = targetToks.findIndex(function(t) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7002804fcf5305ffb6c88d93c201d9e972f9037f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra 
Gerrit-Reviewer: C. Scott Ananian 
Gerrit-Reviewer: Sbailey 
Gerrit-Reviewer: Subramanya Sastry 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Strip everything before the first pf token

2018-01-24 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406057 )

Change subject: Strip everything before the first pf token
..

Strip everything before the first pf token

In this isolate case,
{{safesubst:#if:{{{1}
only "subst:" is part of the same token as the prefix so
`normalizeTarget` doesn't take care of remove the "safesubst:"

The fix here is from noting that we wouldn't be at this place in the
code if the target didn't normalize a canonical function name, so the
contents before the prefix can be safely discarded.

This is another patch along the line of 5608e83 and bcd5572

Bug: T185643
Change-Id: I7002804fcf5305ffb6c88d93c201d9e972f9037f
---
M lib/wt2html/tt/TemplateHandler.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/57/406057/1

diff --git a/lib/wt2html/tt/TemplateHandler.js 
b/lib/wt2html/tt/TemplateHandler.js
index bd00531..33968e4 100644
--- a/lib/wt2html/tt/TemplateHandler.js
+++ b/lib/wt2html/tt/TemplateHandler.js
@@ -473,7 +473,7 @@
if (canonicalFunctionName !== undefined) {
// Extract toks that make up pfArg
var pfArgToks;
-   var re = new RegExp(prefix, 'i');
+   var re = new RegExp('^(.*?)' + prefix, 'i');
 
// Because of the lenient stringifying above, we need to find 
the prefix
var i = targetToks.findIndex(function(t) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7002804fcf5305ffb6c88d93c201d9e972f9037f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits