diff options
Diffstat (limited to 'lib/coderay/scanners')
-rw-r--r-- | lib/coderay/scanners/yaml.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/coderay/scanners/yaml.rb b/lib/coderay/scanners/yaml.rb index d99a38f..932e604 100644 --- a/lib/coderay/scanners/yaml.rb +++ b/lib/coderay/scanners/yaml.rb @@ -60,7 +60,8 @@ module Scanners when match = scan(/[|>][-+]?/) tokens << [:open, :string] tokens << [match, :delimiter] - tokens << [matched, :content] if scan(/(?:\n+ {#{key_indent + 1}}.*)+/) + string_indent = key_indent || column(pos - match.size - 1) + tokens << [matched, :content] if scan(/(?:\n+ {#{string_indent + 1}}.*)+/) tokens << [:close, :string] next when match = scan(/(?![!"*&]).+?(?=$|\s+#)/) |