mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
Merge branch 'stable'
# Conflicts: # src/services/build.js
This commit is contained in:
commit
8725f7cfb2
1
package-lock.json
generated
1
package-lock.json
generated
@ -5,6 +5,7 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
|
"name": "trilium",
|
||||||
"version": "0.59.3",
|
"version": "0.59.3",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"productName": "Trilium Notes",
|
"productName": "Trilium Notes",
|
||||||
"description": "Trilium Notes",
|
"description": "Trilium Notes",
|
||||||
"version": "0.59.3",
|
"version": "0.59.4",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"main": "electron.js",
|
"main": "electron.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -141,7 +141,7 @@ async function processBranchChange(loadResults, ec) {
|
|||||||
const childNote = froca.notes[ec.entity.noteId];
|
const childNote = froca.notes[ec.entity.noteId];
|
||||||
let parentNote = froca.notes[ec.entity.parentNoteId];
|
let parentNote = froca.notes[ec.entity.parentNoteId];
|
||||||
|
|
||||||
if (childNote && !parentNote) {
|
if (childNote && !childNote.isRoot() && !parentNote) {
|
||||||
// a branch cannot exist without the parent
|
// a branch cannot exist without the parent
|
||||||
// a note loaded into froca has to also contain all its ancestors
|
// a note loaded into froca has to also contain all its ancestors
|
||||||
// this problem happened e.g. in sharing where _share was hidden and thus not loaded
|
// this problem happened e.g. in sharing where _share was hidden and thus not loaded
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import libraryLoader from "../services/library_loader.js";
|
import libraryLoader from "../services/library_loader.js";
|
||||||
import NoteContextAwareWidget from "./note_context_aware_widget.js";
|
import NoteContextAwareWidget from "./note_context_aware_widget.js";
|
||||||
import froca from "../services/froca.js";
|
import froca from "../services/froca.js";
|
||||||
import server from "../services/server.js";
|
|
||||||
|
|
||||||
const TPL = `<div class="mermaid-widget">
|
const TPL = `<div class="mermaid-widget">
|
||||||
<style>
|
<style>
|
||||||
@ -74,6 +73,8 @@ export default class MermaidWidget extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
const wheelZoomLoaded = libraryLoader.requireLibrary(libraryLoader.WHEEL_ZOOM);
|
const wheelZoomLoaded = libraryLoader.requireLibrary(libraryLoader.WHEEL_ZOOM);
|
||||||
|
|
||||||
|
this.$errorContainer.hide();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.renderSvg(async renderedSvg => {
|
await this.renderSvg(async renderedSvg => {
|
||||||
this.$display.html(renderedSvg);
|
this.$display.html(renderedSvg);
|
||||||
@ -88,8 +89,6 @@ export default class MermaidWidget extends NoteContextAwareWidget {
|
|||||||
speed: 20,
|
speed: 20,
|
||||||
zoomOnClick: false
|
zoomOnClick: false
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$errorContainer.hide();
|
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$errorMessage.text(e.message);
|
this.$errorMessage.text(e.message);
|
||||||
|
@ -1 +1 @@
|
|||||||
module.exports = { buildDate:"", buildRevision: "9881e6de3e4966af39ec6245562dca6ac7b25eaa" };
|
module.exports = { buildDate:"2023-04-17T21:40:35+02:00", buildRevision: "1d3272e9f8c27106a66227fbb580677ae5d70427" };
|
||||||
|
@ -21,6 +21,7 @@ const dayjs = require("dayjs");
|
|||||||
const htmlSanitizer = require("./html_sanitizer");
|
const htmlSanitizer = require("./html_sanitizer");
|
||||||
const ValidationError = require("../errors/validation_error");
|
const ValidationError = require("../errors/validation_error");
|
||||||
const noteTypesService = require("./note_types");
|
const noteTypesService = require("./note_types");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
function getNewNotePosition(parentNote) {
|
function getNewNotePosition(parentNote) {
|
||||||
if (parentNote.isLabelTruthy('newNotesOnTop')) {
|
if (parentNote.isLabelTruthy('newNotesOnTop')) {
|
||||||
@ -375,7 +376,24 @@ const imageUrlToNoteIdMapping = {};
|
|||||||
|
|
||||||
async function downloadImage(noteId, imageUrl) {
|
async function downloadImage(noteId, imageUrl) {
|
||||||
try {
|
try {
|
||||||
const imageBuffer = await request.getImage(imageUrl);
|
let imageBuffer;
|
||||||
|
|
||||||
|
if (imageUrl.toLowerCase().startsWith("file://")) {
|
||||||
|
imageBuffer = await new Promise((res, rej) => {
|
||||||
|
const localFilePath = imageUrl.substr("file://".length);
|
||||||
|
|
||||||
|
return fs.readFile(localFilePath, (err, data) => {
|
||||||
|
if (err) {
|
||||||
|
rej(err);
|
||||||
|
} else {
|
||||||
|
res(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
imageBuffer = await request.getImage(imageUrl);
|
||||||
|
}
|
||||||
|
|
||||||
const parsedUrl = url.parse(imageUrl);
|
const parsedUrl = url.parse(imageUrl);
|
||||||
const title = path.basename(parsedUrl.pathname);
|
const title = path.basename(parsedUrl.pathname);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user