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();
|
||||
|
||||
if (note.type === 'image') {
|
||||
if (['image', 'canvas', 'mermaid'].includes(note.type)) {
|
||||
// there's no benefit to use insert note functionlity for images,
|
||||
// so we'll just add an IMG tag
|
||||
this.textTypeWidget.addImage(noteId);
|
||||
|
@ -368,9 +368,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
||||
const encodedTitle = encodeURIComponent(note.title);
|
||||
const src = `api/images/${note.noteId}/${encodedTitle}`;
|
||||
|
||||
const imageElement = writer.createElement( 'image', { 'src': src } );
|
||||
|
||||
this.watchdog.editor.model.insertContent(imageElement, this.watchdog.editor.model.document.selection);
|
||||
this.watchdog.editor.execute( 'insertImage', { source: src } );
|
||||
} );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user