https://bugzilla.wikimedia.org/show_bug.cgi?id=62663

            Bug ID: 62663
           Summary: Invalid extension attribute encoding
           Product: Parsoid
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General
          Assignee: gwi...@wikimedia.org
          Reporter: canan...@wikimedia.org
                CC: jforres...@wikimedia.org, ssas...@wikimedia.org
       Web browser: ---
   Mobile Platform: ---

There was a rt crasher:

error in ruwiki:Калашников,_Анатолий_Иванович
TypeError: Object Некоторые работы А. Калашникова на [[почтовая марка|почтовых
марках]],[object Object], ,[object Object],[[СССР]] has no method 'replace'
at Object.Util.escapeEntities
(/usr/lib/parsoid/src/lib/mediawiki.Util.js:1511:14)
at WikitextSerializer.WSP._serializeAttributes
(/usr/lib/parsoid/src/lib/mediawiki.WikitextSerializer.js:3289:15)
at WikitextSerializer.WSP._buildExtensionWT
(/usr/lib/parsoid/src/lib/mediawiki.WikitextSerializer.js:3533:17)

We found a minimal test case:
echo '<gallery caption="&nbsp;"></gallery>' | tests/parse.js --wt2wt
or
echo '<math title="&nbsp;"></math>' | tests/parse.js --wt2wt

The emitted HTML is:
<span data-parsoid='{"src":"&lt;math
title=\"&amp;nbsp;\">&lt;/math>","dsr":[0,28,2,2]}' typeof="mw:Extension/math"
data-mw='{"name":"math","attrs":{"title":[{"type":"TagTk","name":"span","attribs":[{"k":"typeof","v":"mw:Entity"}],"dataAttribs":{"src":"&amp;nbsp;","srcContent":"
","tsr":[13,13]}},"
",{"type":"EndTagTk","name":"span","attribs":[],"dataAttribs":{"tsr":[19,19]}}]},"body":{"extsrc":""}}'
about="#mwt3">
</span>

Note the "type":"TagTk" in data.mw.title.  Tokens don't belong there!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to