diff options
author | Kornelius Kalnbach <murphy@rubychan.de> | 2013-06-23 01:42:32 +0200 |
---|---|---|
committer | Kornelius Kalnbach <murphy@rubychan.de> | 2013-06-23 01:42:32 +0200 |
commit | 39c074f171eeca1c91aa89757a3f3a12fc78323b (patch) | |
tree | b67a24d2bb238600736efe4d50667b2e63711c7d /lib | |
parent | bedd4e4fb5a18270a742e71b65f88fb8e3182050 (diff) | |
download | coderay-39c074f171eeca1c91aa89757a3f3a12fc78323b.tar.gz |
avoid empty tokens in YAML
Diffstat (limited to 'lib')
-rw-r--r-- | lib/coderay/scanners/yaml.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/coderay/scanners/yaml.rb b/lib/coderay/scanners/yaml.rb index 96f4e93..358a3f1 100644 --- a/lib/coderay/scanners/yaml.rb +++ b/lib/coderay/scanners/yaml.rb @@ -47,7 +47,7 @@ module Scanners when !check(/(?:"[^"]*")(?=: |:$)/) && match = scan(/"/) encoder.begin_group :string encoder.text_token match, :delimiter - encoder.text_token match, :content if match = scan(/ [^"\\]* (?: \\. [^"\\]* )* /mx) + encoder.text_token match, :content if (match = scan(/ [^"\\]* (?: \\. [^"\\]* )* /mx)) && !match.empty? encoder.text_token match, :delimiter if match = scan(/"/) encoder.end_group :string next |