Having read What is syntax highlighting and how does it work?, I'm looking for a way to improve the syntax highlighting for XPath.
Currently, the highlighting language for the XPath tag is "default". This results in false-positive "comment" highlighting for lines that start with //
, which is common in XPath.
Prettifier doesn't have support for XPath itself, but lang-xml would be better than the status quo. At least it doesn't treat lines starting with //
as comments.
I tried editing the tag wiki for xpath
, but the language setting didn't seem to be part of what was editable (maybe based on my rep).
Can the syntax highlighting language for the xpath tag be set to lang-xml? Or does anybody have a better idea?
Example:
I edited my answer at Calculate XPath of an html element without attributes so that the first two code samples use the default language setting, so they demonstrate the unwanted comment coloring. The remaining XPath samples are overridden to use lang-xml
and don't have that problem.
!-- language: lang-xml
override. I tried editing the above question but it seems that highlighting doesn't work the same way on meta. Maybe I'll edit the answer linked to in this comment so that the first XPath expression demonstrates the problem.