YAML.pm 1.25 Changelog

综合技术 2018-05-12

This release
contains a lot of little bug fixes, so I thought I'd blog about it.
I hope I didn't break anything but you should be aware that chances are a bit
higher than usual. Please test!

At the Perl Toolchain Summit
I decided to work on trailing comments for YAML.pm, and then I felt like digging a bit deeper
into other bugs.

$YAML::LoadBlessed

YAML::Syck has a $YAML::Syck::LoadBlessed
option to disable loading objects. This is important
when loading YAML from an untrusted source. I added this to YAML::XS last year, and now also YAML.pm
has this option.

See PR 197

Trailing Comments

See myreport on the
summit where I described the changes.

You should be aware that a trailing #
became part of the content
previously. Make sure you put quotes around such data now.

See also PR 189
, PR 190
, PR 191

Mapping keys starting with =

Such keys weren't loaded correctly because they were mistaken as special
"default" keys.

See PR 194

Scalar =
must be quoted

=
is a special default key. When dumping a hash with such a key, it must
be quoted to be interpreted as normal content.

See PR 202

Multiple regexp roundtrip does not grow

When loading and dumping regexes multiple times, it would grow by putting (?^u:...)
around it every time. This bug had been fixed in YAML::XS a while ago.

See PR 203

Fix loading strings with multiple spaces

Top level scalars on the ---
line would lose multiple spaces previously:

--- a text    with multiple spaces
--- "also    spaces in quotes were lost"

See PR 172

Support reverse order of block scalar indicators

Previously, only this was allowed:

---
literal: |-1
  text
folded: >-1
  text

Now, according to the spec, also the reverse order is allowed:

---
literal: |1-
  text
folded: >1-
  text

See PR 205

Add support for compact nested block sequences

In YAML, you can nest block sequences on one line. Previously, with YAML.pm
you had to use this format:

---
-
  -
    - a
    - b

Now you can use this:

---
- - - a
    - b

See PR 204

Allow more characters in anchor name

See PR 196

Support nested mappings in sequences

YAML.pm supported this partially. What has been working is this:

---
- a: 1
  b: 2

But the following did not work as expected:

---
- .: 1 # was loaded as the string ".: 1"

Also, you can now use explicit keys on the same line:

---
- ? |
    key
  : >
    value

See PR 206

Fix parsing of quoted strings

I changed the parsing because the previously used regex was problematic under
certain circumstances.

I actually forgot to add this to the Changes file.

PR 188

Other changes:

  • Remove unused code. See PR 192
  • Use Test::Deep to actually test correctly for class names. See PR 193
  • Disable test with long string under certain conditions. See PR 201

您可能感兴趣的

Morning coffee with the OpenFaaS CLI This is a short blog post that you can follow along with while sipping your morning brew. I'll show you how to create, build, deploy and invoke a bran...
Example 42: Tip of the Week 34 – Encrypt you... Hiera-eyaml is a Hiera backend which can be used to encrypt single keys in Hiera yaml files. It has become the standard the facto to manage p...
Kubectl Cheatsheet Kubctl 命令是操作 kubernetes 集群的最直接和最 skillful 的途径,这个60多MB大小的二进制文件,到底有啥能耐呢?本文是对官方文档的中文翻译,原文地址: https://kubernetes.io/docs/user-guide/kubectl-cheatsheet...
Plait.py – a fake data modeler plait.py plait.py is a program for generating fake data from composable yaml templates. The idea behind plait.py is that it should be easy to mod...
Declarative Configuration for kubeadm — #HeptioPro... In this particular protip, we’ll be focusing on kubeadm , a bootstrapping tool for Kubernetes clusters. Photo Credit: David C...