mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 09:58:32 +02:00
fix saving only image in a note, fixes #77
This commit is contained in:
parent
8e95b080da
commit
90c5348ca7
@ -77,13 +77,15 @@ const noteEditor = (function() {
|
|||||||
|
|
||||||
function updateNoteFromInputs(note) {
|
function updateNoteFromInputs(note) {
|
||||||
if (note.detail.type === 'text') {
|
if (note.detail.type === 'text') {
|
||||||
note.detail.content = editor.getData();
|
let content = editor.getData();
|
||||||
|
|
||||||
// if content is only tags/whitespace (typically <p> </p>), then just make it empty
|
// if content is only tags/whitespace (typically <p> </p>), then just make it empty
|
||||||
// this is important when setting new note to code
|
// this is important when setting new note to code
|
||||||
if (jQuery(note.detail.content).text().trim() === '') {
|
if (jQuery(content).text().trim() === '' && !content.includes("<img")) {
|
||||||
note.detail.content = ''
|
content = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
note.detail.content = content;
|
||||||
}
|
}
|
||||||
else if (note.detail.type === 'code') {
|
else if (note.detail.type === 'code') {
|
||||||
note.detail.content = codeEditor.getValue();
|
note.detail.content = codeEditor.getValue();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user