Last modified: 2013-06-24 20:50:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T51213, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 49213 - Template encapsulation lost or overwritten in unpackDOMFragments
Template encapsulation lost or overwritten in unpackDOMFragments
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
token-stream transforms (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-05 21:34 UTC by Gabriel Wicke
Modified: 2013-06-24 20:50 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gabriel Wicke 2013-06-05 21:34:30 UTC
When transcluding a template containing an extension tag (<references/> for example), template encapsulation is lost. Similartly, when passing in an extension tag as a template parameter the template encapsulation is lost:

echo '{{echo|<references/>}}' | node parse
<body><ol about="#mwt2" class="references" data-mw='{"name":"references","body":{"extsrc":"{{echo|}}"},"attrs":{}}' typeof="mw:Extension/references" data-parsoid='{"tsr":[0,22],"src":"{{echo|<references/>}}","dsr":[0,22,null,null]}'></ol>
</body>

We probably need to be smarter in unpackDOMFragments when the wrapper tokens have already received encapsulation info through token-based template encapsulation.
Comment 1 Gabriel Wicke 2013-06-06 16:41:47 UTC
References is actually a special case as it does not yet use the DOMFragment mechanism. The proper fix is probably to convert it to use DOMFragment encapsulation and generic unpacking.

A generic extension tag like math in a template parameter on the other hand is handled okayish:
echo '{{echo|<math>1+1</math>}}' | node parse --extensions math
<body><p data-parsoid='{"dsr":[0,25,0,0]}'><img class="tex" alt="1+1" src="//upload.wikimedia.org/math/d/9/6/d96e018f51ea61e5ff2f9c349c5da67d.png" data-mw='{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<math>1+1</math>"}}}' typeof="mw:Transclusion" about="#mwt2" data-parsoid='{"tsr":[0,25],"src":"{{echo|<math>1+1</math>}}","dsr":[0,25,null,null]}'></p>
</body>
Comment 2 ssastry 2013-06-24 20:50:53 UTC
Fixed in https://gerrit.wikimedia.org/r/#/c/69020/

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links