aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-06-03 17:24:08 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-06-03 17:24:08 +0200
commit4f9aa69626916e8ba8350779c7ae2d8f1056150a (patch)
tree97da44a46da6645cb3a0bd15114703bd82844826
parentRemove debug prints. (diff)
downloadmuppet-strings-4f9aa69626916e8ba8350779c7ae2d8f1056150a.tar.gz
muppet-strings-4f9aa69626916e8ba8350779c7ae2d8f1056150a.tar.xz
Fix HTML rendering escaping.
-rw-r--r--muppet/data/html.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/muppet/data/html.py b/muppet/data/html.py
index e165dcf..1b155fe 100644
--- a/muppet/data/html.py
+++ b/muppet/data/html.py
@@ -10,6 +10,7 @@ from . import (
render,
)
from collections.abc import Sequence
+import html
class HTMLRenderer(Renderer):
@@ -68,5 +69,5 @@ class HTMLRenderer(Renderer):
return ' ' * ind.depth * 2
def render_str(self, s: str) -> str:
- """Return the given string verbatim."""
- return s
+ """HTML escape and return the given string."""
+ return html.escape(s)