Page MenuHomePhabricator

Ignore <templatedata> strings inside <nowiki> or <pre> in the TemplateData dialog
Closed, ResolvedPublic2 Estimated Story Points

Description

In all cases where we fetch the TemplateData string - either from current page or from a parent page -- make sure to ignore any instances of <templatedata> tag if it is inside a <nowiki> or <pre> tag.

Event Timeline

Mooeypoo claimed this task.
Mooeypoo raised the priority of this task from to Needs Triage.
Mooeypoo updated the task description. (Show Details)
Mooeypoo added a project: TemplateData.
Mooeypoo added subscribers: Mooeypoo, Aklapper.
Krinkle set Security to None.

We're already doing more wikitext parsing ourselves than I would like (i.e. any). Maybe we could use parsoid.

Note: Since https://gerrit.wikimedia.org/r/556011 we ignore HTML comments and <nowiki> tags. We might want to expand this list and add <pre>, <syntaxhighlight>, and maybe the deprecated <source> as well.

Update: I tested this and found that only <nowiki> and <pre> have the special behavior that whatever they contain is not parsed as wikitext. <syntaxhighlight> on the other hand can contain template parameters and can't be excluded because of this.

Change 755387 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/TemplateData@master] Don't extract template parameters from <pre>

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

Change 755387 merged by jenkins-bot:

[mediawiki/extensions/TemplateData@master] Don't extract template parameters from <pre>

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