diff --git a/wwwroot/js/garage.js b/wwwroot/js/garage.js index 8a819ff..2e1f8e2 100644 --- a/wwwroot/js/garage.js +++ b/wwwroot/js/garage.js @@ -71,13 +71,13 @@ function generateReminderItem(id, urgency, description) { } switch (urgency) { case "VeryUrgent": - return `

${description}

`; + return `

${encodeHTMLInput(description)}

`; case "PastDue": - return `

${description}

`; + return `

${encodeHTMLInput(description)}

`; case "Urgent": - return `

${description}

`; + return `

${encodeHTMLInput(description)}

`; case "NotUrgent": - return `

${description}

`; + return `

${encodeHTMLInput(description)}

`; } } function initCalendar() { diff --git a/wwwroot/js/shared.js b/wwwroot/js/shared.js index d4c0eb8..3cd096d 100644 --- a/wwwroot/js/shared.js +++ b/wwwroot/js/shared.js @@ -160,6 +160,11 @@ function bindWindowResize() { hideMobileNav(); }); } +function encodeHTMLInput(input) { + const encoded = document.createElement('div'); + encoded.innerText = input; + return encoded.innerHTML; +} function decodeHTMLEntities(text) { return $("