diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2015-01-17 14:37:11 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2015-01-17 14:37:11 +0900 |
commit | 372449c75b9cb3e418a20d8e3913a9b9b47d915a (patch) | |
tree | f579c432844ca337d6defe0836cf0af6c6180dca /lib/psych/visitors/yaml_tree.rb | |
parent | 48e65f5743a0e335653007afc59e3aea623ec32a (diff) | |
download | psych-372449c75b9cb3e418a20d8e3913a9b9b47d915a.zip |
Fix anchor
Anchors like `\Z` are not valid inside character class.
Use negative-lookahead instead.
Diffstat (limited to 'lib/psych/visitors/yaml_tree.rb')
-rw-r--r-- | lib/psych/visitors/yaml_tree.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/psych/visitors/yaml_tree.rb b/lib/psych/visitors/yaml_tree.rb index c1039c6..8841cb0 100644 --- a/lib/psych/visitors/yaml_tree.rb +++ b/lib/psych/visitors/yaml_tree.rb @@ -310,7 +310,7 @@ module Psych style = Nodes::Scalar::LITERAL plain = false quote = false - elsif o =~ /\n[^\Z]/ # match \n except blank line at the end of string + elsif o =~ /\n(?!\Z)/ # match \n except blank line at the end of string style = Nodes::Scalar::LITERAL elsif o == '<<' style = Nodes::Scalar::SINGLE_QUOTED |