Last modified: 2014-06-03 19:52:07 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 T67871, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65871 - Round-tripping issue in template parameter
Round-tripping issue in template parameter
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Gabriel Wicke
http://parsoid-tests.wikimedia.org/re...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-28 19:10 UTC by Gabriel Wicke
Modified: 2014-06-03 19:52 UTC (History)
3 users (show)

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


Attachments

Description Gabriel Wicke 2014-05-28 19:10:11 UTC
Test case:

{{Rellink|[{{fullurl:{{FULLPAGENAME}}|action=edit}} bar]}}


We don't render this the same way as the PHP parser does. On round-trip, the pipe  after {{FULLPAGENAME}} is then entity-encoded.
Comment 1 ssastry 2014-05-28 19:11:54 UTC
It is a escapeTplArg issue.
Comment 2 Gabriel Wicke 2014-05-28 19:22:32 UTC
(In reply to ssastry from comment #1)
> It is a escapeTplArg issue.

Our HTML also looks very different. The PHP parser produces a link, while we are emitting a span without content.
Comment 3 ssastry 2014-05-28 19:32:29 UTC
Ok, two bugs for the price of one then. :-) I was eating lunch and didn't read the description carefully.
Comment 4 Gerrit Notification Bot 2014-05-28 22:06:27 UTC
Change 135944 had a related patch set uploaded by Arlolra:
Fix entity encoding pipe in nested tpl args

https://gerrit.wikimedia.org/r/135944
Comment 5 Arlo Breault 2014-05-28 22:11:05 UTC
Oh, there's more bug here ... hmm.
Comment 6 Arlo Breault 2014-05-30 04:45:56 UTC
(In reply to Gabriel Wicke from comment #2)
> (In reply to ssastry from comment #1)
> > It is a escapeTplArg issue.
> 
> Our HTML also looks very different. The PHP parser produces a link, while we
> are emitting a span without content.

I think our HTML is ok. The span you're seeing is,

<span>Warning: Page/template fetching disabled, and no cache for Template:Rellink</span>

Try it with prefix enwiki.
Comment 7 Gerrit Notification Bot 2014-06-02 21:27:04 UTC
Change 135944 merged by jenkins-bot:
Fix entity encoding pipe in nested tpl args

https://gerrit.wikimedia.org/r/135944
Comment 8 Gabriel Wicke 2014-06-03 19:46:43 UTC
(In reply to Arlo Breault from comment #6)
> (In reply to Gabriel Wicke from comment #2)
> > (In reply to ssastry from comment #1)
> > > It is a escapeTplArg issue.
> > 
> > Our HTML also looks very different. The PHP parser produces a link, while we
> > are emitting a span without content.
> 
> I think our HTML is ok. The span you're seeing is,
> 
> <span>Warning: Page/template fetching disabled, and no cache for
> Template:Rellink</span>
> 
> Try it with prefix enwiki.

I used parse.js, which defaults to prefix enwiki. I'm pretty sure I didn't see that message, but could be wrong. In any case, great that it's working now.
Comment 9 ssastry 2014-06-03 19:52:07 UTC
For the record, here is our output:

[subbu@earth lib] echo "{{Rellink|[{{fullurl:{{FULLPAGENAME}}|action=edit}} bar]}}" | node parse
...
<div class="hatnote" about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Rellink","href":"./Template:Rellink"},"params":{"1":{"wt":"[{{fullurl:{{FULLPAGENAME}}|action=edit}} bar]"}},"i":0}}]}' data-parsoid='{"stx":"html","dsr":[0,58,null,null],"pi":[[{"k":"1","spc":["","","",""]}]]}'><a rel="mw:ExtLink" href="//en.wikipedia.org/w/index.php?title=Main_Page&amp;action=edit" data-parsoid='{"targetOff":81,"contentOffsets":[81,84],"a":{"href":"//en.wikipedia.org/w/index.php?title=Main_Page&amp;action=edit"},"sa":{"href":"{FULLPAGENAME}}|action=edit}} bar]}}\n"}}'>bar</a></div>


Here is PHP parser output:

<div class="hatnote"><a class="external text" href="//en.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&action=edit">bar</a></div>

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


Navigation
Links