diff --git a/lib/rouge/lexers/yaml.rb b/lib/rouge/lexers/yaml.rb index 1fc31dc72a..89a72f52bc 100644 --- a/lib/rouge/lexers/yaml.rb +++ b/lib/rouge/lexers/yaml.rb @@ -246,7 +246,7 @@ def set_indent(match, opts={}) end end - rule %r/[^\n\r\f\v]+/, Name::Constant + rule %r/[^\n\r\f\v]+/, Str end state :block_scalar_header do diff --git a/spec/visual/samples/yaml b/spec/visual/samples/yaml index 56a1b9ed63..8c711e3d34 100644 --- a/spec/visual/samples/yaml +++ b/spec/visual/samples/yaml @@ -226,9 +226,12 @@ not a number: .NaN # Miscellaneous --- null: ~ -true: boolean -false: boolean +bool_true: true +str_true: 'true' +bool_false: false +str_false: "false" string: '12345' +number: 12345 # Timestamps --- @@ -249,6 +252,7 @@ application specific tag: !something | The semantics of the tag above may be different for different documents. +email_regex: !ruby/regexp '/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i' # Global tags %TAG ! tag:clarkevans.com,2002: