From 2d1ce0cfa501fdfb7427235b61ade96e8f90510a Mon Sep 17 00:00:00 2001 From: WangWeimin Date: Mon, 30 May 2022 15:59:05 +0800 Subject: [PATCH] html encode the `text` of `logbox_append()` --- pywebio_battery/interaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pywebio_battery/interaction.py b/pywebio_battery/interaction.py index dc4a4f7..6513d52 100644 --- a/pywebio_battery/interaction.py +++ b/pywebio_battery/interaction.py @@ -136,4 +136,4 @@ def put_logbox(name, height=400, keep_bottom=True) -> Output: def logbox_append(name, text): """Append text to a logbox widget""" - run_js('$("#webio-logbox-%s").append(text)' % name, text=str(text)) + run_js('$("#webio-logbox-%s").append(document.createTextNode(text))' % name, text=str(text))