perlpunk / YAML-PP-p5

A YAML 1.2 processor in perl
https://metacpan.org/pod/YAML::PP
24 stars 8 forks source link

Bug: Literal scalars with explicit indent seem to have a problem #46

Closed ingydotnet closed 3 years ago

ingydotnet commented 3 years ago

See: https://spec.yaml.io/main/playground/parser?input=LS0tCi0geHh4OiB8MgogICAgICBvbmUKICAgICAgdHdvCiAgICAgIHRocmVlCiAgeXl5OiB8CiAgICBvbmUKICAgIHR3bwogICAgdGhyZWUKICB6eno6IHwKICAgIG9uZQogICAgdHdvCiAgICB0aHJlZQo=

> cat foo.yaml 
---
- xxx: |2
      one
      two
      three
  yyy: |
    one
    two
    three
  zzz: |
    one
    two
    three
> perl -MYAML::PP -e '$y = YAML::PP->new; print $y->dump_string($y->load_file(shift))' foo.yaml 
---
- xxx: |2
        one
        two
        three
    yyy: |
      one
      two
      three
    zzz: |
      one
      two
      three
perlpunk commented 3 years ago

Thanks, fixed in git 80f35685247a805df965d62f8ca53c251630331b

perlpunk commented 3 years ago

released 0.027_001