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.
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 theSolarized (dark)
theme is properly escaped.If you have any suggestion or question, please don't hesitate to let me know.
Many thanks