feat: add explicit option for unquoted attribute values #268
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.
Would it be alright to make an explicit parser option for handling unquoted attribute values?
This is a backward-compatible change that allows users to specify how they want unquoted attributes handled. If it isn't specified, we fall back to the original behavior by following strict/loose mode.
Regression Tests
Similarly to #267, I've run the regression test script from #266, and can confirm it passes.
Alternatives
It looks like downstream projects that want to use strict mode, yet also want to allow unquoted attributes, can safely throw away error events with the message
Unquoted attribute value
if they want this behavior. We could do this instead, if introducing an explicit option upstream is undesirable.Not certain if that way of handling it could be problematic or have side effects, so I thought this change would be safer.
Related