Skip to content

Commit 99f38f7

Browse files
authored
Update script.js
1 parent fd6f306 commit 99f38f7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

script.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ function formatSources(text, sources) {
1616
});
1717
}
1818

19+
// ✅ Decode HTML entities
20+
function decodeHTML(html) {
21+
const txt = document.createElement("textarea");
22+
txt.innerHTML = html;
23+
return txt.value;
24+
}
25+
1926
// Welkomstbericht bij het laden
2027
window.onload = () => {
2128
const welkomstHTML = `
@@ -96,6 +103,7 @@ function renderMessage(cssClass, data) {
96103
.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>")
97104
.replace(/(?<!\*)\*(?!\*)(.*?)\*(?!\*)/g, "<em>$1</em>");
98105
htmlText = formatSources(htmlText, data.sources);
106+
htmlText = decodeHTML(htmlText);
99107

100108
const lines = htmlText.split("\n").filter(line => line.trim() !== "");
101109
const isNumberedList = lines.length > 1 && lines.every(line => /^\d+\.\s+/.test(line));

0 commit comments

Comments
 (0)