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

Allow node names with mixed colons and dashes #34

Merged
merged 1 commit into from
Nov 6, 2022
Merged

Allow node names with mixed colons and dashes #34

merged 1 commit into from
Nov 6, 2022

Conversation

gbj
Copy link
Contributor

@gbj gbj commented Nov 4, 2022

This is a somewhat stupid attempt, but tests pass. It just merges the Colon and Dash variants, and then checks for either a Colon or Dash when it peeks, rather than passing in an allow-list or doing something more generic. I don't think any other punctuation actually ever needs to be included here, so maybe it's fine.

Fixes #33

@stoically
Copy link
Owner

stoically commented Nov 6, 2022

Thanks for working on this. Was trying to find a generic way to solve this to avoid duplication, but couldn't find one either without upstream work. So I'm going ahead and merge this, maybe something pops up in the future.

Was also thinking whether it might make sense to keep the Dash variant for consumers that only want to support dashes, but I guess they could also just check the punctuated variant accordingly.

In terms of HTML spec the attribute name is very flexible, you could basically have almost anything as name. Even something like ::: or what ever: https://stackoverflow.com/a/53563849. That's if you ignore that the spec officially only allows a specific set of attribute names. But I think : and - is fine for a start. If someone needs more, they could always open an issue.

@stoically stoically merged commit 0516f8f into stoically:main Nov 6, 2022
@stoically
Copy link
Owner

Published as v0.9.0-beta.2.

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.

Allow attribute names that mix : and -
2 participants