diff --git a/lib/ace/mode/_test/text_yaml.txt b/lib/ace/mode/_test/text_yaml.txt index 506d3478e99..5d00e67eec7 100644 --- a/lib/ace/mode/_test/text_yaml.txt +++ b/lib/ace/mode/_test/text_yaml.txt @@ -23,6 +23,7 @@ bill-to: &id001 street: | 123 Tornado Alley Suite 16 + ref-id: id123 city: East Centerville state: KS diff --git a/lib/ace/mode/_test/tokens_yaml.json b/lib/ace/mode/_test/tokens_yaml.json index 29a89c6d76e..4770e474bd3 100644 --- a/lib/ace/mode/_test/tokens_yaml.json +++ b/lib/ace/mode/_test/tokens_yaml.json @@ -122,7 +122,12 @@ ],[ "start", ["indent"," "], - ["meta.tag","city"], + ["meta.tag","ref-id"], + ["keyword",":"], + ["text"," id123"] +],[ + "start", + ["meta.tag"," city"], ["keyword",":"], ["text"," East Centerville"] ],[ diff --git a/lib/ace/mode/yaml_highlight_rules.js b/lib/ace/mode/yaml_highlight_rules.js index 56c9db44179..c2a70cd8ee9 100644 --- a/lib/ace/mode/yaml_highlight_rules.js +++ b/lib/ace/mode/yaml_highlight_rules.js @@ -57,10 +57,10 @@ var YamlHighlightRules = function() { regex: "[&\\*][a-zA-Z0-9-_]+" }, { token: ["meta.tag", "keyword"], - regex: /^(\s*\w.*?)(:(?=\s|$))/ + regex: /^(\s*\w[^\s:]*?)(:(?=\s|$))/ },{ token: ["meta.tag", "keyword"], - regex: /(\w+?)(\s*:(?=\s|$))/ + regex: /(\w[^\s:]*?)(\s*:(?=\s|$))/ }, { token : "keyword.operator", regex : "<<\\w*:\\w*"