Page MenuHomePhabricator

Templated link attribute in images doesn't round trip back properly
Closed, ResolvedPublic

Description

[subbu@earth parsoid] echo "[[File:Foo.jpg|alt={{1x|http://google.com}}]]" | parse.js --wt2wt
[[File:Foo.jpg|alt={{1x|http://google.com}}]]

[subbu@earth parsoid] echo "[[File:Foo.jpg|link={{1x|http://google.com}}]]" | parse.js --wt2wt
[[File:Foo.jpg|link=http://google.com]]

[subbu@earth parsoid] echo "[[File:Foo.jpg|thumb={{1x|http://google.com}}]]" | parse.js --wt2wt
[[File:Foo.jpg|thumb={{1x|http://google.com}}]]

The above is a reduced test case for the bug report below:

  1. Edit https://ro.wikipedia.org/w/index.php?title=Lista_sta%C8%9Biilor_de_metrou_din_Bucure%C8%99ti&oldid=10731003 in the Visual Editor and make any change anywhere on the page.
  2. Change to using the wikitext editor.
  3. The page contains some module invocations ({{#invoke:coordonate|link}}) which return a constant string. After the change, these have been substituted with the returned string. While visually correct, this makes maintenance much harder, should the geohack URL change in the future.

Event Timeline

Jdforrester-WMF subscribed.

I think there's a different task about this but I couldn't find it.

I couldn't reproduce this. Can you confirm this?

@ssastry, I can reproduce it reliably on FF 49 on Windows, but I expect it to reproduce in any browser. I think the trick is to edit the page in Visual Editor, change something anywhere on the page, then move to wikitext editor. If no change occurred, the switch is almost instantaneous, which makes me suspect that the text is loaded from the database instead of being converted from the version in Visual Editor.

Ah, okay. Reduced case for this is:

[subbu@earth parsoid] echo "[[File:Foo.jpg|link={{1x|http://google.com}}/foobar]]" | parse.js --wt2wt
[[File:Foo.jpg|link=http://google.com/foobar]]

Dont remember if this is a known limitation, or something that we missed, or a regression. Anyway, to be investigated.

ssastry renamed this task from Moving from Visual Editor to Wikitext editor substitutes module invocation to Templated link attribute in images doesn't round trip back properly.Nov 18 2016, 9:38 PM
ssastry triaged this task as Medium priority.
ssastry updated the task description. (Show Details)
ssastry claimed this task.
[subbu@earth:~/work/wmf/parsoid] echo "[[File:Foo.jpg|alt={{1x|http://google.com}}]]" | php bin/parse.php --wt2wt
[[File:Foo.jpg|alt={{1x|http://google.com}}]]

[subbu@earth:~/work/wmf/parsoid] echo "[[File:Foo.jpg|link={{1x|http://google.com}}]]" | php bin/parse.php --wt2wt
[[File:Foo.jpg|link={{1x|http://google.com}}]]

[subbu@earth:~/work/wmf/parsoid] echo "[[File:Foo.jpg|thumb={{1x|http://google.com}}]]" | php bin/parse.php --wt2wt
[[File:Foo.jpg|thumb={{1x|http://google.com}}]]