mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 09:58:32 +02:00
db setup fixes
This commit is contained in:
parent
b778985b5e
commit
2e55d544f1
@ -95,15 +95,16 @@ class Note extends Entity {
|
|||||||
this.content = "";
|
this.content = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isStringNote()) {
|
|
||||||
this.content = this.content === null
|
|
||||||
? ""
|
|
||||||
: this.content.toString("UTF-8");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.content;
|
if (this.isStringNote()) {
|
||||||
|
return this.content === null
|
||||||
|
? ""
|
||||||
|
: this.content.toString("UTF-8");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return this.content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise<*>} */
|
/** @returns {Promise<*>} */
|
||||||
|
@ -89,15 +89,16 @@ class NoteRevision extends Entity {
|
|||||||
this.content = "";
|
this.content = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isStringNote()) {
|
|
||||||
this.content = this.content === null
|
|
||||||
? ""
|
|
||||||
: this.content.toString("UTF-8");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.content;
|
if (this.isStringNote()) {
|
||||||
|
return this.content === null
|
||||||
|
? ""
|
||||||
|
: this.content.toString("UTF-8");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return this.content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise} */
|
/** @returns {Promise} */
|
||||||
|
@ -256,6 +256,10 @@ function openDialog($dialog) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isHtmlEmpty(html) {
|
function isHtmlEmpty(html) {
|
||||||
|
if (!html) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
html = html.toLowerCase();
|
html = html.toLowerCase();
|
||||||
|
|
||||||
return $("<div>").html(html).text().trim().length === 0
|
return $("<div>").html(html).text().trim().length === 0
|
||||||
|
@ -15,7 +15,7 @@ async function getNote(req) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (note.isStringNote()) {
|
if (note.isStringNote()) {
|
||||||
await note.getContent();
|
note.content = await note.getContent();
|
||||||
|
|
||||||
if (note.type === 'file') {
|
if (note.type === 'file') {
|
||||||
note.content = note.content.substr(0, 10000);
|
note.content = note.content.substr(0, 10000);
|
||||||
|
@ -668,7 +668,7 @@ async function scanForLinks(note) {
|
|||||||
await note.setContent(newContent);
|
await note.setContent(newContent);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
log.error(`Could not scan for links note ${noteId}: ${e.message}`);
|
log.error(`Could not scan for links note ${note.noteId}: ${e.message} ${e.stack}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user