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

minify html double encodes unicode in javascript #185

Open
ibigquant opened this issue Apr 15, 2024 · 0 comments
Open

minify html double encodes unicode in javascript #185

ibigquant opened this issue Apr 15, 2024 · 0 comments

Comments

@ibigquant
Copy link

ibigquant commented Apr 15, 2024

Run the code in jupyter:

from IPython.display import display, HTML
import minify_html

s = '''
<div id="foo">aaaa</div>
<script>
document.getElementById("foo").innerText = "\\u4f60\\u597d";
</script>
'''

display(HTML(s))
display(HTML(minify_html.minify(s.replace("foo", "bar"), minify_js=True, keep_closing_tags=True)))

Expected: display chinese text 你好
Actual: \u4f60\u597d

image
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

No branches or pull requests

1 participant