Cscott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/62535


Change subject: Fix 'echo "{{echo|foo bar}}" | tests/parse.js --wt2wt 
--editMode=yes'
......................................................................

Fix 'echo "{{echo|foo bar}}" | tests/parse.js --wt2wt --editMode=yes'

The <span typeof="mw:Entity">&nbsp;</span> didn't have a TSR entry,
which was causing WSP.escapeTplArgWT to crash (note that the
documentation comment for escapeTplArgWT says that it assumes, "The
tokenizer sets tsr on all non-string tokens").

Add a zero-width TSR on the <span typeof="mw:Entity"> and </span> tags,
which makes WSP hum along happily.

Change-Id: I6c7ac05c918239de982f59e09b02110b8d755c11
---
M js/lib/pegTokenizer.pegjs.txt
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/35/62535/1

diff --git a/js/lib/pegTokenizer.pegjs.txt b/js/lib/pegTokenizer.pegjs.txt
index 7be8ba4..f487ad1 100644
--- a/js/lib/pegTokenizer.pegjs.txt
+++ b/js/lib/pegTokenizer.pegjs.txt
@@ -2154,9 +2154,9 @@
     var m = "&" + c.join('') + ";",
         cc = Util.decodeEntity(m);
     return [
-        new TagTk('span', [new KV('typeof', 'mw:Entity')], { src: m, 
srcContent: cc } ),
+        new TagTk('span', [new KV('typeof', 'mw:Entity')], { src: m, 
srcContent: cc, tsr: [pos0, pos0] } ),
         cc,
-        new EndTagTk('span')
+        new EndTagTk('span', [], { tsr: [pos,pos] })
     ];
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c7ac05c918239de982f59e09b02110b8d755c11
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>

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

Reply via email to