Page MenuHomePhabricator

Parsoid can't handle the nesting of nowiki inside a {{#tag:nowiki}}
Closed, ResolvedPublicBUG REPORT

Description

Hello,

Steps to replicate the issue (include links if applicable):

  • make sure you are using Parsoid
  • publish wikicode with a nowiki tag (either <nowiki> or {{#tag:nowiki}}) within a larger {{#tag:nowiki}}.

See the examples at https://en.wikipedia.org/w/index.php?title=User:GrandEscogriffe/sandbox&oldid=1369849896.

What happens?:

The result is '"UNIQ--nowiki-00000000-QINU"' or similar. The content inside {{#tag:nowiki}} is lost.

What should have happened instead?:

The same as within just one {{#tag:nowiki}} I guess. In any case, no content should be lost and no parasite text displayed.

Other information (browser name/version, screenshots, etc.):

The bug replicates in the two browsers I have tested (Firefox and Chrome) in both desktop and mobile views. It replicates on English and French wikipedias unless Parsoid is disabled.

Details

Event Timeline

Change #1326367 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/core@master] [WIP] Unstrip nowikis inside nowiki tag parser function

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

Curious, where and when is this used?

The French wikipedia template {{code}} has been using {{#tag:nowiki}} since April 2025. When people want to show code, they typically don't want it to be interpreted by Mediawiki so they often put the nowiki tag in the parameter passed to {{code}}. This is currently not necessary, but users may not know it (confusing {{code}} with <code>) and it was in fact necessary between January 2024 and April 2025, when the template did not embed its own nowiki. Here is a list of all the values passed in the template's main parameter, which includes 395 <nowiki>. fr:Brainfuck has examples in the main namespace.

Thank you for providing the context

Change #1326367 merged by jenkins-bot:

[mediawiki/core@master] Unstrip nowikis inside nowiki tag parser function

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