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

Fix #308 by escaping CSS class names #539

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

charlyisidore
Copy link

This pull request is a fix for the issue #308 .

It modifies css_for_theme_with_class_style() to automatically escape special characters in CSS class names according to the CSS specification.

For example, .123 is replaced by .\31 23, and .c++ is replaced by .c\2b \2b .

Class names are escaped using the added function escape_css_identifier().

This PR also adds two tests: one to check the result of escape_css_identifier(), and one to check if the generated CSS for the Solarized (dark) theme is properly escaped.

If you have any suggestion or question, please don't hesitate to let me know.

Many thanks

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