Page MenuHomePhabricator

Interaction of linktrail and template encapsulation not handled
Closed, ResolvedPublic

Description

[subbu@earth lib] echo "{{echo|[[Foo]]}}l" | node parse --wt2wt
{{echo|[[Foo]]}}

The wt2wt of that snippet is clearly losing the linktrail from source wikitext. This seems to be because the linktrail/linkprefix DOM pass that runs late in the DOM post-processing stage doesn't update data-mw of the transclusion to include info about the linktrail. See below.

[subbu@earth lib] echo "{{echo|[[Foo]]}}l" | node parse --dump dom:post-encap | & sed "s/"/'/g;"

  • DOM: post-encapsulation -------

<head data-parsoid="{'tmp':{}}"></head><body data-parsoid="{'tmp':{},'dsr':[0,18,0,0]}"><p data-parsoid="{'tagId':1,'tmp':{},'dsr':[0,17,0,0]}"><a rel="mw:WikiLink" href="./Foo" about="#mwt1" typeof="mw:Transclusion" data-mw="{'parts':[{'template':{'target':{'wt':'echo','href':'./Template:Echo'},'params':{'1':{'wt':'[[Foo]]'}},'i':0}}]}" data-parsoid="{'stx':'simple','a':{'href':'./Foo'},'sa':{'href':'Foo'},'tagId':3,'tmp':{},'dsr':[0,16,null,null],'src':'{{echo|[[Foo]]}}','pi':[[{'k':'1','spc':['','','','']}]]}">Foo</a>l</p>

</body>

<body data-parsoid='{"dsr":[0,18,0,0]}'><p data-parsoid='{"dsr":[0,17,0,0]}'><a rel="mw:WikiLink" href="./Foo" about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Foo]]"}},"i":0}}]}' data-parsoid='{"stx":"simple","a":{"href":"./Foo"},"sa":{"href":"Foo"},"dsr":[0,17,null,1],"pi":[[{"k":"1","spc":["","","",""]}]],"tail":"l"}'>Fool</a></p>
</body>


Version: unspecified
Severity: normal

Details

Reference
bz60752

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:05 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz60752.

Change 111966 had a related patch set uploaded by Arlolra:
Handle interaction between linktrail and template

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

Change 111966 merged by jenkins-bot:
Handle interaction between linktrail and template

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

Change 112923 had a related patch set uploaded by Arlolra:
Follow up on linktrail / template interaction

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

Change 112923 merged by jenkins-bot:
Follow up on linktrail / template interaction

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