lib/uttk/dumpers/Yaml.rb in uttk-0.3.6.1 vs lib/uttk/dumpers/Yaml.rb in uttk-0.4.5.0
- old
+ new
@@ -1,9 +1,9 @@
# Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
# Copyright:: Copyright (c) 2004, 2005 Uttk team. All rights reserved.
# License:: LGPL
-# $Id: /w/fey/uttk/trunk/lib/uttk/dumpers/Yaml.rb 22676 2006-03-11T21:17:42.382165Z pouillar $
+# $Id: /w/fey/uttk/trunk/lib/uttk/dumpers/Yaml.rb 24396 2006-07-10T08:23:37.784417Z ertai $
class Symbol
alias_method :old_to_yaml, :to_yaml
def to_yaml ( opts={} )
if YAML.have_option? opts, :uttk
@@ -89,10 +89,10 @@
def new_leaf ( path, leaf )
super
puts_header
val = leaf
return if val.respond_to?(:hidden)
- if val.is_a?(String) and val =~ /\n/
+ if val.is_a?(String) and val =~ /[\n"]/
if val =~ /\A[ \t]/
val = "|#{MAP_INDENT}\n#{val}"
else
val = "|\n#{val}"
end