15

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

7
  • SE / SO do not maintain the highlighter. Moreover, I don't think that's even using XQuery highlighting -- it looks like PHP highlighting, with Capitalised Class and Object names in bright blue
    – cat
    Apr 15, 2016 at 13:17
  • @cat, yes, that's the problem I'm requesting support with -- I'm (to the best of my knowledge) specifying the highlighter in the manner documented in the SO Help Center, yet it's not using XQuery highlighting. Apr 15, 2016 at 13:18
  • @cat, ...indeed, the highlighter is a third-party component, but you'll note that I provided a link to the relevant source of that component, down to the specific line of source that would be causing things to work as intended if the correct language were in fact in use. Apr 15, 2016 at 13:19
  • 1
    If it's a separate JS file then SE explicitly integrate it, cf MATLAB. XQuery doesn't have highlighting enabled (see meta.stackexchange.com/q/184108/179419 for how to find out and more info). Change this into a feature request to add the highlighting.
    – Ben
    Apr 15, 2016 at 14:55
  • 8
    Instead of adding yet another FR to the pile of tiny improvements you might consider supporting the FR to implement highlight-js
    – rene
    Apr 15, 2016 at 19:19
  • In addition to @rene's comment, note that highlight.js already supports XQuery highlighing so the proposed changed would also solve this issue.
    – Tunaki
    Apr 15, 2016 at 21:02
  • 2
    Note that there are a lot of FRs to add languages that Prettify already supports that have gotten no traction with SO staff. This will probably be another of them. Apr 18, 2016 at 2:26

0

You must log in to answer this question.

Browse other questions tagged .