cleanup: remove duplicate escapeHtml function, add null check to remaining one
This commit is contained in:
@@ -4042,6 +4042,7 @@ function scrollLogsToBottom() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function escapeHtml(text) {
|
function escapeHtml(text) {
|
||||||
|
if (!text) return '';
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.textContent = text;
|
div.textContent = text;
|
||||||
return div.innerHTML;
|
return div.innerHTML;
|
||||||
@@ -5908,13 +5909,6 @@ function filterMemories(listId, searchTerm) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function escapeHtml(str) {
|
|
||||||
if (!str) return '';
|
|
||||||
const div = document.createElement('div');
|
|
||||||
div.textContent = str;
|
|
||||||
return div.innerHTML;
|
|
||||||
}
|
|
||||||
|
|
||||||
function escapeJsonForAttribute(obj) {
|
function escapeJsonForAttribute(obj) {
|
||||||
// Properly escape JSON for use in HTML attributes
|
// Properly escape JSON for use in HTML attributes
|
||||||
return JSON.stringify(obj)
|
return JSON.stringify(obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user