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

Adds validation message for duplicate attributes #392

Merged
merged 3 commits into from
May 26, 2023

Conversation

rpaul-stripe
Copy link
Contributor

@rpaul-stripe rpaul-stripe commented May 26, 2023

This PR addresses issue #391. It modifies the annotate function in the parser so that it appends an error to the node's errors array when it detects a duplicate attribute. This does not actually change the rendering behavior of duplicate attributes—it still gives precedence to the last one added. I also added test cases to verify that this works as expected for multiple attributes in the same tag, multiple attributes in the same annotation, and multiple attributes across separate annotations on the same document node.

Closes #391

@rpaul-stripe rpaul-stripe force-pushed the duplicate-attribute-validation branch from 19affb2 to 5833250 Compare May 26, 2023 20:10
@rpaul-stripe rpaul-stripe merged commit 32c581c into main May 26, 2023
2 checks passed
@rpaul-stripe rpaul-stripe deleted the duplicate-attribute-validation branch May 26, 2023 20:48
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.

Duplicate attributes don't create validation errors
2 participants