mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
note content refactoring, WIP
This commit is contained in:
@@ -8,7 +8,7 @@ function showDialog() {
|
||||
|
||||
$dialog.modal();
|
||||
|
||||
const noteText = noteDetailService.getCurrentNote().content;
|
||||
const noteText = noteDetailService.getCurrentNote().noteContent.content;
|
||||
|
||||
$noteSource.text(formatHtml(noteText));
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ async function saveNote() {
|
||||
}
|
||||
|
||||
note.title = $noteTitle.val();
|
||||
note.content = getCurrentNoteContent(note);
|
||||
note.noteContent.content = getCurrentNoteContent(note);
|
||||
|
||||
// it's important to set the flag back to false immediatelly after retrieving title and content
|
||||
// otherwise we might overwrite another change (especially async code)
|
||||
|
||||
@@ -111,13 +111,13 @@ async function renderTooltip(note, attributes) {
|
||||
}
|
||||
|
||||
if (note.type === 'text') {
|
||||
// surround with <div> for a case when note.content is pure text (e.g. "[protected]") which
|
||||
// surround with <div> for a case when note's content is pure text (e.g. "[protected]") which
|
||||
// then fails the jquery non-empty text test
|
||||
content += '<div>' + note.content + '</div>';
|
||||
content += '<div>' + note.noteContent.content + '</div>';
|
||||
}
|
||||
else if (note.type === 'code') {
|
||||
content += $("<pre>")
|
||||
.text(note.content)
|
||||
.text(note.noteContent.content)
|
||||
.prop('outerHTML');
|
||||
}
|
||||
else if (note.type === 'image') {
|
||||
|
||||
Reference in New Issue
Block a user