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

       Web browser: ---
            Bug ID: 60752
           Summary: Interaction of linktrail and template encapsulation
                    not handled
           Product: Parsoid
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General
          Assignee: gwi...@wikimedia.org
          Reporter: ssas...@wikimedia.org
                CC: jforres...@wikimedia.org, ssas...@wikimedia.org
    Classification: Unclassified
   Mobile Platform: ---

[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>

-- 
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