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

Improve lazy YAML parsing to apply in defined directives only #54

Merged
merged 3 commits into from
Aug 18, 2018

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Aug 18, 2018

The previous lazy YAML parser cannot parse lazy string when mixed strict string wrapped by quotes. This YAML's color property is always null even if lazyYAML is true.

header: "header"
color: #369

The same case also occurs if there was a not defined directive in Marpit.

color: #f00
notSupported: key

This PR will improve this behavior to allow lazy string only in defined directives.
The new parser will parse strict YAML always, but passed YAML is preprocessed to wrap lazy string by quotes.

Before Preprocessed
color: #fff
backgroundColor: #369
header: Improved "YAML" parser
notDefinedDirective: #def
color: "#fff"
backgroundColor: "#369"
header: "Improved \"YAML\" parser"
notDefinedDirective: #def

@yhatt yhatt merged commit 04db825 into master Aug 18, 2018
@yhatt yhatt deleted the improve-lazy-yaml-parser branch August 18, 2018 08:31
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

Successfully merging this pull request may close these issues.

1 participant