mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix content renderer of protected canvas/mermaid notes, closes #4414
This commit is contained in:
parent
4bdb40904f
commit
5a38bf78e1
@ -1156,14 +1156,8 @@ class BNote extends AbstractBeccaEntity {
|
|||||||
|
|
||||||
/** @returns {BAttachment} */
|
/** @returns {BAttachment} */
|
||||||
getAttachmentByTitle(title) {
|
getAttachmentByTitle(title) {
|
||||||
return sql.getRows(`
|
// cannot use SQL to filter by title since it can be encrypted
|
||||||
SELECT attachments.*
|
return this.getAttachments().filter(attachment => attachment.title === title)[0];
|
||||||
FROM attachments
|
|
||||||
WHERE ownerId = ?
|
|
||||||
AND title = ?
|
|
||||||
AND isDeleted = 0
|
|
||||||
ORDER BY position`, [this.noteId, title])
|
|
||||||
.map(row => new BAttachment(row))[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -157,14 +157,8 @@ class BRevision extends AbstractBeccaEntity {
|
|||||||
|
|
||||||
/** @returns {BAttachment} */
|
/** @returns {BAttachment} */
|
||||||
getAttachmentByTitle(title) {
|
getAttachmentByTitle(title) {
|
||||||
return sql.getRows(`
|
// cannot use SQL to filter by title since it can be encrypted
|
||||||
SELECT attachments.*
|
return this.getAttachments().filter(attachment => attachment.title === title)[0];
|
||||||
FROM attachments
|
|
||||||
WHERE ownerId = ?
|
|
||||||
AND title = ?
|
|
||||||
AND isDeleted = 0
|
|
||||||
ORDER BY position`, [this.revisionId, title])
|
|
||||||
.map(row => new BAttachment(row))[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user