Description
This is a sub issue of #1762 and it's related to the following test:
pyscript/pyscript.core/tests/integration/test_01_basic.py
Lines 162 to 184 in c6aaacd
Something is very weird when it comes to <py-script>
parsing. If you try to run this code:
<py-script>import js; js.console.log("C", 1<2, 1>2)</py-script>
<py-script>import js; js.console.log("D <div></div>")</py-script>
<py-script>
import js
js.console.log("E", 1<2, 1>2);
js.console.log("F <div></div>")
</py-script>
With PyScript classic, you get the following output, as expected:
C true false
D <div></div>
E true false
F <div></div>
With 2023.09.1RC1, something very weird happens: the "C" and "D" line are parsed correctly, but the "E" line causes troubles:
You can see it in action here (and you can also see that by using 2023.05.1 it works):
https://pyscript.com/@antocuni/py-script-escaping/latest
I know that <py-script>
parsing is fragile and bad things can happen, but if pyscript classic was able to deal with it correctly, then pyscript next should do the same.
For reference, this is the code which was responsible to decode the content inside <py-script>
tags in classic:
pyscript/pyscriptjs/src/utils.ts
Lines 9 to 12 in 52bd64c