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

Escaped characters in CSS are not properly kept #399

Open
benoit74 opened this issue Sep 20, 2024 · 0 comments
Open

Escaped characters in CSS are not properly kept #399

benoit74 opened this issue Sep 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@benoit74
Copy link
Collaborator

This test is failing:

def test_rewrite_css2(no_js_notify):
    output = (
        HtmlRewriter(
            ArticleUrlRewriter(HttpUrl("http://kiwix.org/"), set()),
            "",
            "",
            no_js_notify,
        )
        .rewrite(
            r'<style>.test { content="\e123" }</style>',
        )
        .content
    )
    assert output == r'<style>.test { content="\e123" }</style>'

Looks like "\e123" is interpreted somehow by the parser.

This is encountered in the wild on https://geo.libretexts.org/Courses/Coastline_College/An_Introduction_To_Geology_-_Coastline_College/01%3A_Understanding_Science/1.01%3A_What_is_Science where we have such inline CSS.

@benoit74 benoit74 added the bug Something isn't working label Sep 20, 2024
@benoit74 benoit74 assigned benoit74 and unassigned benoit74 Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant