mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
tweak automatic selection of mode
This commit is contained in:
parent
9879e5ce51
commit
a0bf81ed8f
15
node_modules/ace/lib/ace/mode/json_highlight_rules.js
generated
vendored
15
node_modules/ace/lib/ace/mode/json_highlight_rules.js
generated
vendored
@ -60,8 +60,12 @@ var JsonHighlightRules = function() {
|
||||
token : "invalid.illegal", // single quoted strings are not allowed
|
||||
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
||||
}, {
|
||||
token : "invalid.illegal", // comments are not allowed
|
||||
token : "comment", // comments are not allowed, but who cares?
|
||||
regex : "\\/\\/.*$"
|
||||
}, {
|
||||
token : "comment.start", // comments are not allowed, but who cares?
|
||||
regex : "\\/\\*",
|
||||
next : "comment"
|
||||
}, {
|
||||
token : "paren.lparen",
|
||||
regex : "[[({]"
|
||||
@ -89,6 +93,15 @@ var JsonHighlightRules = function() {
|
||||
regex : "",
|
||||
next : "start"
|
||||
}
|
||||
],
|
||||
"comment" : [
|
||||
{
|
||||
token : "comment.end", // comments are not allowed, but who cares?
|
||||
regex : "\\*\\/",
|
||||
next : "start"
|
||||
}, {
|
||||
defaultToken: "comment"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
@ -1477,9 +1477,12 @@ define(function(require, exports, module) {
|
||||
else if (/<\?xml/.test(firstLine)) {
|
||||
syntax = "xml";
|
||||
}
|
||||
else if (/^{/.test(firstLine)) {
|
||||
else if (/^{\s*("|$)/.test(firstLine)) {
|
||||
syntax = "json";
|
||||
}
|
||||
else if (/^---$/.test(firstLine)) {
|
||||
syntax = "yaml";
|
||||
}
|
||||
else if (/\.(bash|inputrc|profile|zsh)/.test(path)) {
|
||||
syntax = "sh";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user