Page MenuHomePhabricator

Parsoid doesn't handle templated template names yet
Closed, ResolvedPublic

Description

Note: https://www.mediawiki.org/wiki/Template:Translatable_template_name is a bit strange.

Steps to reproduce:

  1. Create a page that contains something like {{ {{TNTN|Warning}} |Test}}.
  2. Edit the page in VisualEditor.
  3. Change the contents of the template (e.g., replace "Test" with a different word).

Results:

  • In visual mode, it displays badly (showing raw wikitext), can't be edited using the template dialog, and gets nowiki'd when you save it.
  • In the wikitext mode, it displays correctly, previews badly, but doesn't get nowiki'd when you save it.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 21 2016, 6:46 PM
Arlolra edited projects, added Parsoid; removed Parsoid-Nowiki.Dec 21 2016, 6:49 PM
Arlolra added a subscriber: Arlolra.

Yeah, this is a Parsoid bug. I noted it the other day on IRC,

echo "{{ {{1x|1x}} | hi ho }}" | node bin/parse --normalize
[warn/dsr/inconsistent][enwiki/Main Page] DSR inconsistency: cs/s mismatch for node: BODY s: 0 ; cs: 1

<p>{{1x | hi ho }}</p>

Ugh .. didn't think templated template names were actually used anywhere. But, okay, I guess this needs revisiting.

Between Meta and mw.org alone, templated template names are probably used on about 50,000 translated pages.

ssastry renamed this task from VisualEditor doesn't play well with Template:Translatable_template_name to Parsoid doesn't handle templated template names yet.Dec 22 2016, 6:29 PM
ssastry triaged this task as Medium priority.
ssastry removed a project: VisualEditor.

Change 328854 had a related patch set uploaded (by Subramanya Sastry):
HACKY WIP: T153885: Handle templated template names

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

Change 328854 merged by jenkins-bot:
[mediawiki/services/parsoid@master] T153885: Handle templated template names

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