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.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Don't extract template parameters from <pre> | mediawiki/extensions/TemplateData | master | +6 -4 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | thiemowmde | T91326 Ignore <templatedata> strings inside <nowiki> or <pre> in the TemplateData dialog | |||
Resolved | SD0001 | T237195 Templatedata API includes parameters that only exist within comments (for templates mising templatedata) |
Event Timeline
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>
Change 755387 merged by jenkins-bot:
[mediawiki/extensions/TemplateData@master] Don't extract template parameters from <pre>