This repository was archived by the owner on Jun 25, 2020. It is now read-only.
Handle object lists that start on the same line as the - #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
yaml.js has trouble parsing files that look like this one: http://ua-parser.googlecode.com/svn/trunk/resources/user_agent_parser.yaml
The problem appears to be sections like this:
This needs to translate into an object with keys
regex
andfamily_replacement
, with the object inside a list.The problem is that yaml.js sees a different indent for the two lines and gets confused.
This patch changes the input to look like this:
Which yaml.js is much happier with.
We could probably do much more to make the parser more intelligent, but in this case just canonicalizing the input is simpler and may be faster.