Skip to content

Several blank lines in multi-line scalar values collapsed to one #13

@Witiko

Description

@Witiko

The following two YAML documents will produce the same output when passed to tinyyaml.parse().

first_input = [[
abstract: |
  This is *the abstract*.
  It consists of two paragraphs.
]]

second_input = [[
abstract: |
  This is *the abstract*.

  It consists of two paragraphs.
]]

tinyyaml = require("tinyyaml")
for k, v in pairs(tinyyaml.parse(first_input)) do
  print(k, v)
end
for k, v in pairs(tinyyaml.parse(second_input)) do
  print(k, v)
end

Executing the above code in Lua 5.2.4 and in Lua 5.3 gives me the following results:

abstract        This is *the abstract*.
It consists of two paragraphs.

abstract        This is *the abstract*.
It consists of two paragraphs.

Here is the expected output:

abstract        This is *the abstract*.
It consists of two paragraphs.

abstract        This is *the abstract*.

It consists of two paragraphs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions