diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2021-08-04 17:10:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-04 17:10:02 -0700 |
commit | 02f759dd74cbd3787263c5a32b7505fc8ddf76cc (patch) | |
tree | fb18fccb5b96335dc30a7229d08d59fbf55b3c12 /lib | |
parent | 0179e0cf481018c83f711211bb0f15a1871fa335 (diff) | |
parent | 6a1c30634e61967f3d8133b3181b9f301ff7f550 (diff) | |
download | psych-02f759dd74cbd3787263c5a32b7505fc8ddf76cc.tar.gz |
Merge pull request #515 from ruby/quote-y-n
Add quotes to the strings "y" and "n"
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psych/visitors/yaml_tree.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/psych/visitors/yaml_tree.rb b/lib/psych/visitors/yaml_tree.rb index 05748dd..2eee4d3 100644 --- a/lib/psych/visitors/yaml_tree.rb +++ b/lib/psych/visitors/yaml_tree.rb @@ -272,6 +272,8 @@ module Psych tag = 'tag:yaml.org,2002:str' plain = false quote = false + elsif o == 'y' || o == 'n' + style = Nodes::Scalar::DOUBLE_QUOTED elsif @line_width && o.length > @line_width style = Nodes::Scalar::FOLDED elsif o =~ /^[^[:word:]][^"]*$/ |