Page MenuHomePhabricator

Syntax highlighting does not recognise slash in tag parameter string correctly
Open, Needs TriagePublicBUG REPORT

Description

Steps to reproduce: Open the wiki editor and enable syntax highlighting. Declare a reference with a name containing a slash, like <ref name="1/2">Book by Author, page NaN</ref>. Use it in a template parameter like |param1=text1<ref name="1/2"/>, then close the template and continue the page prose. Include another reference like <ref>yeah, more sources</ref> and some more text after it.

Expected result: The whole template should be highlighted in the violet font, the prose text should not be highlighted.

Actual result: The template is highlighted correctly until the problematic reference is called, the rest of the template syntax appears to be recognised as if it was part of the reference. The prose text after the second reference is highlighted as if it was part of the template, even though the template is already closed.

(encountered at https://en.wikipedia.org/w/index.php?title=Daimler_Regency&action=edit, see https://test.wikipedia.org/wiki/T270880 for a minimal example)

syntaxhighlight bug.png (190×1 px, 8 KB)

Event Timeline

1234qwer1234qwer4 changed the subtype of this task from "Task" to "Bug Report".

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

[mediawiki/extensions/CodeMirror@master] Fix MediaWiki highlighter partly failing on quoted attributes

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

Thanks. I am a bit unsure about the > mark mentioned in the patch description however, as it does not seem to be parsed as part of the string in some/most occasions anyway: https://test.wikipedia.org/wiki/Reftest

Change 682188 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] Fix MediaWiki highlighter partly failing on quoted attributes

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