minify html double encodes unicode in javascript
ibigquant opened this issue · 0 comments
ibigquant commented
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