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

feat: add explicit option for unquoted attribute values #268

Merged
merged 1 commit into from
May 27, 2024

Conversation

SethFalco
Copy link
Contributor

@SethFalco SethFalco commented Jan 13, 2024

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

isaacs pushed a commit that referenced this pull request May 27, 2024
@isaacs isaacs closed this in 30aab25 May 27, 2024
@isaacs isaacs merged commit 30aab25 into isaacs:main May 27, 2024
14 of 16 checks passed
@SethFalco SethFalco deleted the unquoted-attrib-option branch May 28, 2024 01:27
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.

2 participants