Page MenuHomePhabricator

Unnecessary nowiki escaping of [ and ] chars in template arg.
Closed, ResolvedPublic0 Estimated Story Points

Description

Steps to reproduce:

  1. https://fr.wikipedia.org/wiki/Robert_Soucy?veaction=edit
  2. Find the template with 'Soucy a écrit une belle histoire sociale de la France, qui souligne'
  3. Open dialog on that template
  4. Select parameter 'Texte'
  5. Add a ' ' (space) at the end
  6. Accept changes, Save page, Review your changes

{{citation|Soucy a écrit une belle histoire sociale de la France, qui souligne [dans ''French fascism''] l’importance de l’appui financier des riches sympathisants et de son attrait généralisé aux yeux des membres petit-bourgeois du parti<ref>James F. McMillan, historien britannique, ''{{lang|en|texte=London Times Literary Supplement}}'', 1995.</ref>.}}

becomes

{{citation|1=<nowiki>Soucy a écrit une belle histoire sociale de la France, qui souligne [dans </nowiki>''French fascism''<nowiki>] l’importance de l’appui financier des riches sympathisants et de son attrait généralisé aux yeux des membres petit-bourgeois du parti</nowiki><ref>James F. McMillan, historien britannique, ''{{lang|en|texte=London Times Literary Supplement}}'', 1995</ref>.}}

This was a parsoid topfail.
http://parsoid.wmflabs.org:8001/topfails/1
http://parsoid.wmflabs.org:8001/latestresult/fr/Robert_Soucy


Version: unspecified
Severity: normal

Details

Reference
bz51961

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:09 AM
bzimport set Reference to bz51961.

Related: Bug 52268

I am sure a similar problem as in bug 52268 is causing this (although in the context of a single arg).

I opened bug 52824 separately for the conversion of the positional parameter to a named parameter. This bug is about the nowiki escaping only.

Arlolra added a project: Parsoid.
Arlolra set Security to None.

The problem comes from the escaping of template arguments, which sees the '[' separately from the ']' due to the italicized text in the middle and thus wraps both sides in nowikis:

$ echo "{{echo|a [ ''b'' ] c}}" | node parse --wt2wt

{{echo|<nowiki>a [ </nowiki>''b''<nowiki> ] c</nowiki>}}

Change 196427 had a related patch set uploaded (by Marcoil):
T53961: Improve escaping and nowikiing template arguments

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

Change 196427 merged by jenkins-bot:
T53961: Improve escaping and nowikiing template arguments

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

Checked in production - the edited template is saved without extraneous escaping.