diff options
author | murphy <murphy@rubychan.de> | 2009-04-22 03:11:21 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2009-04-22 03:11:21 +0000 |
commit | de1bcdee24198385146018c70c4635e539549b48 (patch) | |
tree | 1216e4f2d043a671dd8bcc69e845c51b98bf5625 /lib/coderay/scanners | |
parent | 26c543a2eda041a0e4a5508e073dfac4494c2ff2 (diff) | |
download | coderay-de1bcdee24198385146018c70c4635e539549b48.tar.gz |
Fixed a minor bug in the YAML scanner.
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+#)/) |