diff --git a/src/lib/markdown-safe.ts b/src/lib/markdown-safe.ts
index eba4d91..deec436 100644
--- a/src/lib/markdown-safe.ts
+++ b/src/lib/markdown-safe.ts
@@ -23,9 +23,18 @@ function configure() {
marked.setOptions({ gfm: true });
marked.use({
renderer: {
- // Inline raw HTML: `<...>` → bleibt wörtlich als Text stehen.
- html() {
- return '';
+ // Allow only and — strip all other raw HTML.
+ html(token: { text: string }) {
+ let s = token.text;
+ // Protect (style value must not contain < or >)
+ s = s.replace(/]{0,400})"\s*>/gi, '\x00span:$1\x00');
+ s = s.replace(/<\/span>/gi, '\x00/span\x00');
+ // Strip all remaining HTML tags
+ s = s.replace(/<[^>]+>/g, '');
+ // Restore safe spans
+ s = s.replace(/\x00span:([^\x00]*)\x00/g, '');
+ s = s.replace(/\x00\/span\x00/g, '');
+ return s;
},
},
});