Page MenuHomePhabricator

Syntax highlighting does not recognise slash in tag parameter string correctly
Closed, ResolvedPublicBUG 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

The minimal example looks good to me as does the cited wikitext page in edit mode. Was the 'partly failing fix' actually a full fix or is there another example of this somewhere?

I guess "partly failing" just means that the highlighter wasn't always failing, so the issue described initially should be resolved. However, as I wrote in my comment further above, the change introduced a new inconsistency between the syntax highlighting and the actual output.

TheDJ claimed this task.
TheDJ subscribed.

calling this fixed

as I wrote in my comment further above, the change introduced a new inconsistency between the syntax highlighting and the actual output.

@1234qwer1234qwer4, I think this is better tracked in a new ticket. Can you create one?

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

[mediawiki/extensions/CodeMirror@master] Fix inconsistent parsing of quoted tag attributes

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

Change 769454 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] Fix inconsistent parsing of quoted tag attributes

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