Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(parser) language grammars have a name attribute now #2400

Merged
merged 4 commits into from Feb 15, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -10,6 +10,7 @@ New themes:

Core Changes:

- every language can have a `name` attribute now (#2400) [Josh Goebel][]
- improve regular expression detect (less false-positives) (#2380) [Josh Goebel][]
- make `noHighlightRe` and `languagePrefixRe` configurable (#2374) [Josh Goebel][]

Expand Down
3 changes: 3 additions & 0 deletions src/highlight.js
Expand Up @@ -952,6 +952,9 @@ https://highlightjs.org/
// entire highlighter
lang = PLAINTEXT_LANGUAGE;
}
// give it a temporary name if it doesn't have one in the meta-data
if (!lang.name)
lang.name = name;
languages[name] = lang;
lang.rawDefinition = language.bind(null,hljs);

Expand Down
1 change: 1 addition & 0 deletions src/languages/sql.js
Expand Up @@ -8,6 +8,7 @@
function(hljs) {
var COMMENT_MODE = hljs.COMMENT('--', '$');
return {
name: "SQL",
case_insensitive: true,
illegal: /[<>{}*]/,
contains: [
Expand Down