Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v1_9_1_378) is shown here.
node_text( value, block = nil )
public
Emit plain, normal flowing text
Show source
def node_text( value, block = nil )
@seq_map = false
valx = value.dup
unless block
block =
if options(:UseBlock)
'|'
elsif not options(:UseFold) and valx =~ /\n[ \t]/ and not valx =~ /#{YAML::ESCAPE_CHAR}/
'|'
else
'>'
end
indt = $&.to_i if block =~ /\d+/
if valx =~ /(\A\n*[ \t#]|^---\s+)/
indt = options(:Indent) unless indt.to_i > 0
block += indt.to_s
end
block +=
if valx =~ /\n\Z\n/
"+"
elsif valx =~ /\Z\n/
""
else
"-"
end
end
block += "\n"
if block[0] == ""
esc_skip = ( "\t\n" unless valx =~ /^[ \t]/ ) || ""
valx = fold( YAML::escape( valx, esc_skip ) + "\"" ).chomp
self << '"' + indent_text( valx, indt, false )
else
if block[0] == >>
valx = fold( valx )
end
self << block + indent_text( valx, indt )
end
end