diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/coderay/scanners/yaml.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/coderay/scanners/yaml.rb b/lib/coderay/scanners/yaml.rb index 514838d..a0b1ae2 100644 --- a/lib/coderay/scanners/yaml.rb +++ b/lib/coderay/scanners/yaml.rb @@ -60,9 +60,11 @@ module Scanners encoder.end_group :string next when match = scan(/(?![!"*&]).+?(?=$|\s+#)/) - encoder.text_token match, :string + encoder.begin_group :string + encoder.text_token match, :content string_indent = key_indent || column(pos - match.size - 1) - encoder.text_token matched, :string if scan(/(?:\n+ {#{string_indent + 1}}.*)+/) + encoder.text_token matched, :content if scan(/(?:\n+ {#{string_indent + 1}}.*)+/) + encoder.end_group :string next end |