diff options
author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-15 18:17:43 +0000 |
---|---|---|
committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-15 18:17:43 +0000 |
commit | b75b9455ac9fbf816f9eb38f2815f584dea6dc7f (patch) | |
tree | 281fcae2c3b98524e32707f0a14878997f4b5a7d /lib/yaml | |
parent | ee72d97e99c786f087c7ec39d5f2efbb7a505252 (diff) |
* lib/yaml/rubytypes.rb: comments in strings. [ruby-talk:88012]
* test/yaml/test_yaml.rb: add test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml')
-rw-r--r-- | lib/yaml/rubytypes.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb index f718df9b9f..a29c4fda8b 100644 --- a/lib/yaml/rubytypes.rb +++ b/lib/yaml/rubytypes.rb @@ -304,7 +304,7 @@ class String self elsif empty? "''" - elsif self =~ /^[^#{YAML::WORD_CHAR}]|#{YAML::ESCAPE_CHAR}|[#{YAML::SPACE_INDICATORS}]( |$)| $|\n|\'/ + elsif self =~ /^[^#{YAML::WORD_CHAR}]| \#|#{YAML::ESCAPE_CHAR}|[#{YAML::SPACE_INDICATORS}]( |$)| $|\n|\'/ "\"#{YAML.escape( self )}\"" elsif YAML.detect_implicit( self ) != 'str' "\"#{YAML.escape( self )}\"" |