mirror of
https://github.com/zadam/trilium.git
synced 2026-05-07 11:45:58 +02:00
Merge branch 'develop' into feature/MFA
This commit is contained in:
@@ -6,4 +6,14 @@ describe("Link", () => {
|
||||
const output = parseNavigationStateFromUrl("http://localhost:8080/#?searchString=hello");
|
||||
expect(output).toMatchObject({ searchString: "hello" });
|
||||
});
|
||||
|
||||
it("parses searchString with hash", () => {
|
||||
const output = parseNavigationStateFromUrl("https://github.com/orgs/TriliumNext/discussions/1526#discussioncomment-12656660");
|
||||
expect(output).toStrictEqual({});
|
||||
});
|
||||
|
||||
it("parses notePath", () => {
|
||||
const output = parseNavigationStateFromUrl(`#root/WWaBNf3SSA1b/mQ2tIzLVFKHL`);
|
||||
expect(output).toMatchObject({ notePath: "root/WWaBNf3SSA1b/mQ2tIzLVFKHL", noteId: "mQ2tIzLVFKHL" });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -238,10 +238,14 @@ export function parseNavigationStateFromUrl(url: string | undefined) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!notePath.match(/^[_a-z0-9]{4,}(\/[_a-z0-9]{4,})*$/i)) {
|
||||
if (searchString) {
|
||||
return { searchString }
|
||||
}
|
||||
|
||||
if (!notePath.match(/^[_a-z0-9]{4,}(\/[_a-z0-9]{4,})*$/i)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return {
|
||||
notePath,
|
||||
noteId: treeService.getNoteIdFromUrl(notePath),
|
||||
|
||||
@@ -2,6 +2,7 @@ import TypeWidget from "./type_widget.js";
|
||||
import utils from "../../services/utils.js";
|
||||
import linkService from "../../services/link.js";
|
||||
import server from "../../services/server.js";
|
||||
import asset_path from "../../../../services/asset_path.js";
|
||||
import type FNote from "../../entities/fnote.js";
|
||||
import type { ExcalidrawElement, Theme } from "@excalidraw/excalidraw/element/types";
|
||||
import type { AppState, BinaryFileData, ExcalidrawImperativeAPI, ExcalidrawProps, LibraryItem, SceneData } from "@excalidraw/excalidraw/types";
|
||||
@@ -129,9 +130,9 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
|
||||
this.SCENE_VERSION_INITIAL = -1; // -1 indicates that it is fresh. excalidraw scene version is always >0
|
||||
this.SCENE_VERSION_ERROR = -2; // -2 indicates error
|
||||
|
||||
// ensure that assets are loaded from trilium
|
||||
// TODO:
|
||||
(window as any).EXCALIDRAW_ASSET_PATH = `${window.location.origin}/node_modules/@excalidraw/excalidraw/dist/`;
|
||||
// currently required by excalidraw, in order to allows self-hosting fonts locally.
|
||||
// this avoids making excalidraw load the fonts from an external CDN.
|
||||
(window as any).EXCALIDRAW_ASSET_PATH = `${window.location.origin}/${asset_path}/app-dist/excalidraw/`;
|
||||
|
||||
// temporary vars
|
||||
this.currentNoteId = "";
|
||||
|
||||
@@ -47,6 +47,11 @@ const TPL = `
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Workaround for #1327 */
|
||||
body.desktop.electron .note-detail-editable-text {
|
||||
letter-spacing: -0.01px;
|
||||
}
|
||||
|
||||
body.mobile .note-detail-editable-text {
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user