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

Document end marker after every open ended document? #50

Open
perlpunk opened this issue Dec 28, 2019 · 1 comment
Open

Document end marker after every open ended document? #50

perlpunk opened this issue Dec 28, 2019 · 1 comment

Comments

@perlpunk
Copy link
Member

perlpunk commented Dec 28, 2019

See also #49

If we have an open ended block scalar at the end of the stream:

keep: |+
  line1


It should be emitted as:

keep: |+
  line1


...

But maybe this rule should not only be for the last document in a stream, but for every document, which is especially important in streaming context:

---
keep: |+
  line1


--- doc two

Every document should be able to taken out of a stream and represent the same. If you take it out and accidentally add a newline, then it has one more empty line.

So when emitting the above documents, the output should look like this:

---
keep: |+
  line1


...
--- doc two

What do you think? @ingydotnet @hvr @eemeli @pantoniou @am11

Note: This rule is for emitters. The marker would not be required when parsing.

Note 2: Open-ended only means block scalars with trailing empty lines (|+, >+). I know that in YAML 1.1 open-ended has a slightly different meaning.

@ingydotnet
Copy link
Member

@perlpunk I think this should include blank lines as well. ie any trailing lines without visible characters.

@perlpunk perlpunk moved this from Backlog to Postponed in Release 2020-02-11 Feb 11, 2020
@perlpunk perlpunk added this to Backlog in Release Planning Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Release 2020-02-11
  
Postponed
Release Planning
  
Backlog
Development

No branches or pull requests

2 participants