fix quoting

This commit is contained in:
2026-07-25 21:49:11 +02:00
parent b6c906636c
commit eea70ed62e
5 changed files with 55 additions and 21 deletions

View File

@@ -306,7 +306,7 @@ if (!window.UserCommentSystem) {
const trimmed = line.trimStart();
if (trimmed.startsWith('>') && !trimmed.match(/^>>\d+/)) {
const quoteContent = line.substring(line.indexOf('>') + 1);
return `<span class="greentext">&gt;${quoteContent}</span>`;
return `<span class="greentext">&gt;${quoteContent.replace(/>/g, '&gt;')}</span>`;
}
// Per-line limit
@@ -450,7 +450,7 @@ if (!window.UserCommentSystem) {
if (!unsafe) return '';
const div = document.createElement('div');
div.textContent = unsafe;
return div.innerHTML;
return div.innerHTML.replace(/"/g, '&quot;').replace(/'/g, '&#39;');
}
}
}