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

#661@patch: Take class selector escaping into account. #662

Merged
merged 2 commits into from Dec 3, 2022

Conversation

petejodo
Copy link
Contributor

This is definitely not the best way of doing this but it does seem to fix the issue #661. This is more of a proof of concept or pathfinder for how to fix the issue properly. See the issue for more details.

const TAG_NAME_REGEXP = /^[a-zA-Z0-9-]+/;
const ID_REGEXP = /#[A-Za-z][-A-Za-z0-9_]*/g;
const CSS_ESCAPE_REGEXP = /(?<!\\):/g;
Copy link
Contributor Author

@petejodo petejodo Nov 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this escape should be more than just for : but don't know if I can just have it be any arbitrary character or a set of characters that can be escaped like [:#&...] in which case I'd have to go look up what characters those are but I'm a bit time-constrained right now

@petejodo petejodo marked this pull request as ready for review November 21, 2022 18:33
@capricorn86
Copy link
Owner

Thank you for your contribution @petejodo! 🙂

I have made a commit to include any escaped character. I also added some more unit tests.

I feel pretty confident in that this should work as there is good test coverage, so I will therefore release it.

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.

None yet

2 participants