Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Witiko opened this issue Sep 6, 2021 · 0 comments
Open

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

Witiko opened this issue Sep 6, 2021 · 0 comments

Comments

@Witiko
Copy link

Witiko commented Sep 6, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant