I recently tried to add <!-- language: lang-xq -->
to properly syntax-highlight a snippet of XQuery code in a StackOverflow question:
for $n in Movies//Movie//OtherTitles
let $d := ($n/OtherTitleName/text(),$n/Year/text())
return $d
(: let $d := concat($n/OtherTitleName/text(),$n/Year/text()) <- Gives me error :)
Notably, comments in XQuery are delimited by (:
and :)
. However, the above snippet appears as of this writing to be treating //
as a line-oriented comment delimiter (which it is not in XQuery), and failing to recognize (:
or :)
.
This mechanism for specifying a language is documented in the editing-help site, and lang-xq
is present in the Prettify source base and correctly recognizes (:
and :)
as comments (see line 49 as of current master). Thus, it appears that the language specification is not being honored; is this a usage error?
Update: Feature request
Per feedback from Ben:
If it's a separate JS file then SE explicitly integrate it, cf MATLAB. XQuery doesn't have highlighting enabled (see What is syntax highlighting and how does it work? for how to find out and more info). Change this into a feature request to add the highlighting. – Ben 45 mins ago