Page MenuHomePhabricator

Visual editor changing automatically something in text while saving
Closed, ResolvedPublic

Description

Users don't really like that now visual editor started to change automatically something in text, like "Kuva" to "Tiedosto". It means changing the "Image" to "File". For example: https://fi.wikipedia.org/w/index.php?title=Muinainen_Egypti&diff=prev&oldid=18506181

See discussion on Finnish Wikipedia: https://fi.wikipedia.org/wiki/Wikipedia:Kahvihuone_(tekniikka)#Tarpeettomia_automaattisia_nollamuokkauksia_sotkemisen_yhteydess%C3%A4

It makes it more difficult to find what the editor really changed in the article.
Is this a bug or a feature of visual editor?

Event Timeline

This is a bug, visual editor is not supposed to make any "cleanup" changes not intended by the user.

I made a smaller test case at https://fi.wikipedia.org/wiki/Käyttäjä:Matma_Rex/T237040, where I can reproduce the problem reliably. (In the "Review your changes" dialog, I didn't save it.)

I can't tell at the moment if this a problem in VE or Parsoid. For reference, this is a relevant fragment of the HTML we receive:

<figure class="mw-default-size" typeof="mw:Image/Thumb" id="mwLw"><a href="./Tiedosto:Ramses_II_at_Kadesh.jpg" id="mwMA"><img resource="./Tiedosto:Ramses_II_at_Kadesh.jpg" src="//upload.wikimedia.org/wikipedia/commons/thumb/c/cc/Ramses_II_at_Kadesh.jpg/250px-Ramses_II_at_Kadesh.jpg" data-file-width="300" data-file-height="369" data-file-type="bitmap" height="308" width="250" srcset="//upload.wikimedia.org/wikipedia/commons/c/cc/Ramses_II_at_Kadesh.jpg 2x, //upload.wikimedia.org/wikipedia/commons/c/cc/Ramses_II_at_Kadesh.jpg 1.5x" id="mwMQ"/></a><figcaption id="mwMg">Ramses II sotavaunussaan Kadeshin-sotaretkellään. Reliefi <a rel="mw:WikiLink" href="./Abu_Simbel" title="Abu Simbel" id="mwMw">Abu Simbelissä</a>.</figcaption></figure>

And this is what we send back:

<figure typeof="mw:Image/Thumb" class="mw-default-size" id="mwLw"><a href="./Tiedosto:Ramses II at Kadesh.jpg" id="mwMA"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/c/cc/Ramses_II_at_Kadesh.jpg/250px-Ramses_II_at_Kadesh.jpg" width="250" height="308" resource="./Tiedosto:Ramses II at Kadesh.jpg" data-file-width="300" data-file-height="369" data-file-type="bitmap" srcset="//upload.wikimedia.org/wikipedia/commons/c/cc/Ramses_II_at_Kadesh.jpg 2x, //upload.wikimedia.org/wikipedia/commons/c/cc/Ramses_II_at_Kadesh.jpg 1.5x" id="mwMQ"></a><figcaption id="mwMg">Ramses II sotavaunussaan Kadeshin-sotaretkellään. Reliefi <a href="./Abu_Simbel" rel="mw:WikiLink" title="Abu Simbel" id="mwMw">Abu Simbelissä</a>.</figcaption></figure>

There is a notable difference – the href and resource attributes use spaces instead of underscores.

matmarex triaged this task as Unbreak Now! priority.Oct 31 2019, 9:38 PM

This isn't quite data loss, but dirty diffs are annoying, so we should fix this as soon as possible.

I was able to reproduce on my local wiki as well, the same issue occurs in English (with 'Image:' turning into 'File:').

Reverting patch I linked above fixes the issue. It will regress T193253, but that's a less severe problem.

Change 547660 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Revert "Parse relative hrefs on image nodes like on regular links"

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

The buggy patch was in version 1.35.0-wmf.2, which was deployed to Wikimedia wikis in the week of 15-17 October.

Change 547660 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Revert "Parse relative hrefs on image nodes like on regular links"

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

Change 547667 had a related patch set uploaded (by Jforrester; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@wmf/1.35.0-wmf.4] Revert "Parse relative hrefs on image nodes like on regular links"

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

Change 547667 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@wmf/1.35.0-wmf.4] Revert "Parse relative hrefs on image nodes like on regular links"

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

Mentioned in SAL (#wikimedia-operations) [2019-10-31T23:24:32Z] <urbanecm@deploy1001> Synchronized php-1.35.0-wmf.4/extensions/VisualEditor/: SWAT: rEVED3686b82922e6: Revert "Parse relative hrefs on image nodes like on regular links" (T237040) (duration: 00m 53s)

ppelberg claimed this task.