aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example/static/gemtext/cheatsheet.gmi6
-rw-r--r--internal/gemtext/gemtext.go2
2 files changed, 6 insertions, 2 deletions
diff --git a/example/static/gemtext/cheatsheet.gmi b/example/static/gemtext/cheatsheet.gmi
index e7c9286..953c294 100644
--- a/example/static/gemtext/cheatsheet.gmi
+++ b/example/static/gemtext/cheatsheet.gmi
@@ -59,4 +59,8 @@ Here's a quote from Maciej Cegłowski:
## Pre-fromatted text
-Lines which start with ``` will cause clients to toggle in and out of ordinary rendering mode and preformatted mode. In preformatted mode, Gemtext syntax is ignored so links etc. will not be rendered, and text will appear in a monospace font.
+Lines which start with ``` will cause clients to toggle in and out of ordinary rendering mode and preformatted mode. In preformatted mode, Gemtext syntax is ignored so links etc. will not be rendered, and text will appear in a monospace font.
+
+```
+<script>alert("HTML tags should not get rendered!")</script>
+```
diff --git a/internal/gemtext/gemtext.go b/internal/gemtext/gemtext.go
index 83a1be3..76a990e 100644
--- a/internal/gemtext/gemtext.go
+++ b/internal/gemtext/gemtext.go
@@ -74,7 +74,7 @@ loop:
continue
case pft:
- write(line)
+ write(html.EscapeString(line))
continue
case len(strings.TrimSpace(line)) == 0: