mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
when canvas and mermaid are inserted using "include note", we insert them as images
This commit is contained in:
parent
d07f02b95f
commit
686af0c6a1
@ -97,7 +97,7 @@ export default class IncludeNoteDialog extends BasicWidget {
|
|||||||
|
|
||||||
const boxSize = $("input[name='include-note-box-size']:checked").val();
|
const boxSize = $("input[name='include-note-box-size']:checked").val();
|
||||||
|
|
||||||
if (note.type === 'image') {
|
if (['image', 'canvas', 'mermaid'].includes(note.type)) {
|
||||||
// there's no benefit to use insert note functionlity for images,
|
// there's no benefit to use insert note functionlity for images,
|
||||||
// so we'll just add an IMG tag
|
// so we'll just add an IMG tag
|
||||||
this.textTypeWidget.addImage(noteId);
|
this.textTypeWidget.addImage(noteId);
|
||||||
|
@ -368,9 +368,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
const encodedTitle = encodeURIComponent(note.title);
|
const encodedTitle = encodeURIComponent(note.title);
|
||||||
const src = `api/images/${note.noteId}/${encodedTitle}`;
|
const src = `api/images/${note.noteId}/${encodedTitle}`;
|
||||||
|
|
||||||
const imageElement = writer.createElement( 'image', { 'src': src } );
|
this.watchdog.editor.execute( 'insertImage', { source: src } );
|
||||||
|
|
||||||
this.watchdog.editor.model.insertContent(imageElement, this.watchdog.editor.model.document.selection);
|
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user