diff --git a/bot.html b/bot.html
index a46a7cf..57a690e 100644
--- a/bot.html
+++ b/bot.html
@@ -1,9 +1,10 @@
-
-
-
+
+
+
+
Pytml Help Bot
@@ -626,12 +627,14 @@ Hello
bubble.className = 'bubble';
if (role === 'bot') {
- bubble.innerHTML = formatBotText(text);
+ bubble.innerHTML = window.DOMPurify ? DOMPurify.sanitize(formatBotText(text)) : formatBotText(text);
// highlight code blocks inside this bubble
- const codes = bubble.querySelectorAll('pre code');
- codes.forEach((block) => {
- hljs.highlightElement(block);
- });
+ if (window.hljs) {
+ const codes = bubble.querySelectorAll('pre code');
+ codes.forEach((block) => {
+ window.hljs.highlightElement(block);
+ });
+ }
} else {
bubble.textContent = text;
}
diff --git a/package.json b/package.json
index 89ac05b..805fe66 100644
--- a/package.json
+++ b/package.json
@@ -3,6 +3,9 @@
"version": "0.1.0",
"private": true,
"type": "module",
+ "scripts": {
+ "build": "echo \"No build step required for Pytml static assets\""
+ },
"engines": {
"node": ">=18"
},