[PORT] Enable no-jquery/no-parse-html-literal
and fix violation (gitea#31684)
Tested it, path segment creation works just like before. --- Conflict resolution: trivial, also ported code from https://github.com/go-gitea/gitea/pull/31283
This commit is contained in:
parent
22de4ae9c4
commit
2cf91d58e7
4 changed files with 44 additions and 13 deletions
|
@ -296,3 +296,10 @@ export function replaceTextareaSelection(textarea, text) {
|
|||
textarea.dispatchEvent(new CustomEvent('change', {bubbles: true, cancelable: true}));
|
||||
}
|
||||
}
|
||||
|
||||
// Warning: Do not enter any unsanitized variables here
|
||||
export function createElementFromHTML(htmlString) {
|
||||
const div = document.createElement('div');
|
||||
div.innerHTML = htmlString.trim();
|
||||
return div.firstChild;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue