diff --git a/demo/kitchen-sink/docs/yaml.yaml b/demo/kitchen-sink/docs/yaml.yaml index 52ee320e6a1..e8747db791d 100644 --- a/demo/kitchen-sink/docs/yaml.yaml +++ b/demo/kitchen-sink/docs/yaml.yaml @@ -18,6 +18,7 @@ items: size: 8 price: 100.27 quantity: 1 + version: 1.2.3.4 bill-to: &id001 street: | diff --git a/lib/ace/mode/_test/text_yaml.txt b/lib/ace/mode/_test/text_yaml.txt index 5d00e67eec7..e2c083cdd19 100644 --- a/lib/ace/mode/_test/text_yaml.txt +++ b/lib/ace/mode/_test/text_yaml.txt @@ -18,6 +18,7 @@ items: size: 8 price: 100.27 quantity: 1 + version: 1.2.3.4 bill-to: &id001 street: | diff --git a/lib/ace/mode/_test/tokens_yaml.json b/lib/ace/mode/_test/tokens_yaml.json index 4770e474bd3..694ddd5ecd1 100644 --- a/lib/ace/mode/_test/tokens_yaml.json +++ b/lib/ace/mode/_test/tokens_yaml.json @@ -97,6 +97,11 @@ ["keyword",":"], ["text"," "], ["constant.numeric","1"] +],[ + "start", + ["meta.tag"," version"], + ["keyword",":"], + ["text"," 1.2.3.4"] ],[ "start" ],[ @@ -124,7 +129,7 @@ ["indent"," "], ["meta.tag","ref-id"], ["keyword",":"], - ["text"," id123"] + ["text"," id123 "] ],[ "start", ["meta.tag"," city"], diff --git a/lib/ace/mode/yaml_highlight_rules.js b/lib/ace/mode/yaml_highlight_rules.js index c2a70cd8ee9..f4622521890 100644 --- a/lib/ace/mode/yaml_highlight_rules.js +++ b/lib/ace/mode/yaml_highlight_rules.js @@ -100,7 +100,7 @@ var YamlHighlightRules = function() { regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { token : "constant.numeric", // float - regex : /(\b|[+\-\.])[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)(?=[^\d-\w]|$)/ + regex : /(\b|[+\-])[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)(?=[^\d-\w]|$)$/ }, { token : "constant.numeric", // other number regex : /[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/