diff --git a/web_src/js/utils/dom.ts b/web_src/js/utils/dom.ts index 8bb9b8defc..4bbb0c414a 100644 --- a/web_src/js/utils/dom.ts +++ b/web_src/js/utils/dom.ts @@ -301,13 +301,13 @@ export function replaceTextareaSelection(textarea: HTMLTextAreaElement, text: st } // Warning: Do not enter any unsanitized variables here -export function createElementFromHTML(htmlString: string): T { +export function createElementFromHTML(htmlString: string): T { htmlString = htmlString.trim(); // some tags like "tr" are special, it must use a correct parent container to create if (htmlString.startsWith('('tr'); } const div = document.createElement('div'); div.innerHTML = htmlString;