Subject: | YAML::Tiny strips space after newline in verb blocks |
Date: | Mon, 29 Mar 2010 10:11:26 +0100 |
To: | bug-YAML-Tiny [...] rt.cpan.org |
From: | Ben Morrow <ben [...] morrow.me.uk> |
YAML::Tiny 1.41 appears to strip any space after a newline in verbatim
blocks (blocks initiated with '|'). See the attached test.
It would be somewhat reasonable for YAML::Tiny to not implement | blocks
at all, but it should give an error rather than incorrect data.
This is with perl 5.10.1 on FreeBSD.
Ben
#!/usr/bin/perl
use Test::More tests => 1;
use YAML::Tiny qw/Load/;
my $str = <<STR;
one
two
three
STR
(my $indent = $str) =~ s/^/ /mg;
my $yaml = Load <<YAML;
foo: |
$indent
YAML
is $yaml->{foo}, $str, "Verbatim text isn't corrupted";