Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    highlight.js doesn’t support PL/SQL, and Stack Overflow in particular only supports SQL, which is a shame, since highlight.js has a separate definition for pgSQL (which includes PL/pgSQL!) that’s of vastly superior quality to the SQL definition. Commented Oct 5, 2020 at 9:01
  • 1
    We support PL/SQL via PL/pgSQL... if StackOverflow wished to provide that variant, they could. "SQL" is intended to be very basic (although sadly it's currently got MySQL mixed in with it). Really the SQL variants are so different that to get the best results you really need to use one specific to the server variant you're using - which is why they should all be broken out into separate grammars. There are also size concerns (which might be why Stack Overflow just doesn't want to add everything in the kitchen sink)... I'm definitely open to making our "simple" SQL support better. Commented Oct 7, 2020 at 15:13
  • 1
    I'm making a small change to SQL that will always match strings (even if outside an apparent SQL statement) that will prevent examples like those above from being totally broken. github.com/highlightjs/highlight.js/pull/2740 Commented Oct 7, 2020 at 15:41
  • I'm guessing the "MySQL mixed" is why only the first declaration after a declare keyword is highlighted. In PL/SQL declare marks the start of a section containing multiple items and ending with begin. Commented Oct 10, 2020 at 9:15
  • Since PL/SQL is a wrapper for SQL (among other things) perhaps there is a way to include a common SQL grammar and extend it with begin/end/loop etc for PL/SQL. But then I've never written a JavaScript syntax parser so I have no idea what I'm talking about (though I did extend my fork of code-prettify to include PL/SQL. Commented Oct 10, 2020 at 9:16