fix(views/board): creating new notes would render as HTML

This commit is contained in:
Elian Doran 2025-07-21 13:14:07 +03:00
parent 3a569499cb
commit 96ca3d5e38
No known key found for this signature in database

View File

@ -192,7 +192,7 @@ export class DifferentialBoardRenderer {
$existingCard.contents().filter(function() { $existingCard.contents().filter(function() {
return this.nodeType === 3; // Text nodes return this.nodeType === 3; // Text nodes
}).remove(); }).remove();
$existingCard.append(item.note.title); $existingCard.append(document.createTextNode(item.note.title));
} }
// Ensure card is in correct position // Ensure card is in correct position
@ -413,7 +413,8 @@ export class DifferentialBoardRenderer {
// Restore the card content // Restore the card content
const iconClass = $card.attr('data-icon-class') || 'bx bx-file'; const iconClass = $card.attr('data-icon-class') || 'bx bx-file';
const $newIcon = $('<span>').addClass('icon').addClass(iconClass); const $newIcon = $('<span>').addClass('icon').addClass(iconClass);
$card.empty().append($newIcon, finalTitle); $card.text(finalTitle);
$card.prepend($newIcon);
// Re-attach click handler for quick edit (for existing cards) // Re-attach click handler for quick edit (for existing cards)
$card.on('click', () => appContext.triggerCommand("openInPopup", { noteIdOrPath: noteId })); $card.on('click', () => appContext.triggerCommand("openInPopup", { noteIdOrPath: noteId }));