Unnecessary nowiki escaping of [ and ] chars in template arg.
Closed, ResolvedPublic

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

bzimport added a project: Parsoid-Serializer.Via ConduitNov 22 2014, 2:09 AM
bzimport set Reference to bz51961.
jayvdb created this task.Via LegacyJul 24 2013, 12:46 PM
ssastry added a comment.Via ConduitJul 30 2013, 5:35 PM

Related: Bug 52268

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

GWicke added a comment.Via ConduitAug 13 2013, 11:51 PM

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 placed this task up for grabs.Via WebNov 25 2014, 7:09 PM
Arlolra added a project: Parsoid.
Arlolra set Security to None.
ssastry moved this task to html2wt: nowikis on the Parsoid workboard.Via WebDec 20 2014, 5:08 PM
RobLa-WMF added a project: Parsoid-Nowiki.Via WebFeb 11 2015, 8:10 PM
marcoil moved this task to Backlog on the Parsoid workboard.Via WebFeb 13 2015, 12:47 PM
ssastry moved this task to VE Q4 on the Parsoid workboard.Via WebWed, Mar 11, 11:52 PM
marcoil claimed this task.Via WebThu, Mar 12, 1:30 PM
marcoil added a comment.Via WebThu, Mar 12, 3:39 PM

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>}}
gerritbot added a subscriber: gerritbot.Via ConduitThu, Mar 12, 9:12 PM

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

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

gerritbot added a project: Patch-For-Review.Via ConduitThu, Mar 12, 9:12 PM
gerritbot added a comment.Via ConduitFri, Mar 13, 4:44 PM

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

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

Etonkovidova added a subscriber: Etonkovidova.Via WebWed, Mar 18, 6:56 PM

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

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.