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) {
|
||||
if (!text) return '';
|
||||
const div = document.createElement('div');
|
||||
div.textContent = text;
|
||||
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) {
|
||||
// Properly escape JSON for use in HTML attributes
|
||||
return JSON.stringify(obj)
|
||||
|
||||
Reference in New Issue
Block a user