Update page-window.js

This commit is contained in:
2025-11-23 22:20:52 +08:00
committed by GitHub
parent 886273b4ab
commit b8523539e3

View File

@@ -120,12 +120,22 @@ export function showHtmlModal(title, htmlContent, options = {}) {
}
function escapeHtml(text) {
if (!text) return '';
return text
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}
export function showSummaryModal(summaryText, callbacks) {
const { onConfirm, onRegenerate, onCancel } = callbacks;
const modalHtml = `
<div class="historiographer-summary-modal">
<textarea class="text_pole" style="width: 100%; height: 50vh; resize: vertical;">${summaryText}</textarea>
<textarea class="text_pole" style="width: 100%; height: 50vh; resize: vertical;">${escapeHtml(summaryText)}</textarea>
</div>
`;