mirror of
https://github.com/obsqrbtz/goose-highlighter.git
synced 2026-04-08 20:19:06 +03:00
fix: excame html in popup.js
This commit is contained in:
@@ -12,6 +12,18 @@ let saveTimeout;
|
||||
let selectedCheckboxes = new Set();
|
||||
let globalHighlightEnabled = true;
|
||||
|
||||
function escapeHtml(str) {
|
||||
return str.replace(/[&<>"']/g, function (m) {
|
||||
return ({
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": '''
|
||||
})[m];
|
||||
});
|
||||
}
|
||||
|
||||
async function debouncedSave() {
|
||||
clearTimeout(saveTimeout);
|
||||
saveTimeout = setTimeout(async () => {
|
||||
@@ -79,7 +91,9 @@ async function load() {
|
||||
}
|
||||
|
||||
function renderLists() {
|
||||
listSelect.innerHTML = lists.map((list, index) => `<option value="${index}">${list.name}</option>`).join("");
|
||||
listSelect.innerHTML = lists.map((list, index) =>
|
||||
`<option value="${index}">${escapeHtml(list.name)}</option>`
|
||||
).join("");
|
||||
listSelect.value = currentListIndex;
|
||||
updateListForm();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user