minify-html icon indicating copy to clipboard operation
minify-html copied to clipboard

minify html double encodes unicode in javascript

Open ibigquant opened this issue 1 year ago • 0 comments

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

ibigquant avatar Apr 15 '24 15:04 ibigquant