pull/3/head
Zef Hemel 2022-06-14 16:55:50 +02:00
parent 5dbe71568e
commit 17d4553fa9
2 changed files with 3 additions and 5 deletions

View File

@ -194,8 +194,6 @@ export class Editor {
let globalModules: any = await (await fetch("/global.plug.json")).json(); let globalModules: any = await (await fetch("/global.plug.json")).json();
console.log("Global modules", globalModules);
this.system.on({ this.system.on({
plugLoaded: (plug) => { plugLoaded: (plug) => {
safeRun(async () => { safeRun(async () => {
@ -224,11 +222,10 @@ export class Editor {
}, },
}); });
await this.reloadPlugs();
if (this.pageNavigator.getCurrentPage() === "") { if (this.pageNavigator.getCurrentPage() === "") {
await this.pageNavigator.navigate("start"); await this.pageNavigator.navigate("start");
} }
await this.reloadPlugs();
} }
async save(immediate: boolean = false): Promise<void> { async save(immediate: boolean = false): Promise<void> {
@ -474,7 +471,9 @@ export class Editor {
rebuildEditorState() { rebuildEditorState() {
const editorView = this.editorView; const editorView = this.editorView;
console.log("Rebuilding editor state");
if (editorView && this.currentPage) { if (editorView && this.currentPage) {
console.log("Getting all syntax extensions");
this.mdExtensions = loadMarkdownExtensions(this.system); this.mdExtensions = loadMarkdownExtensions(this.system);
// And reload the syscalls to use the new syntax extensions // And reload the syscalls to use the new syntax extensions

View File

@ -21,7 +21,6 @@ export const pasteLinkExtension = ViewPlugin.fromClass(
let pastedString = pastedText.join(""); let pastedString = pastedText.join("");
if (pastedString.match(urlRegexp)) { if (pastedString.match(urlRegexp)) {
let selection = update.startState.selection.main; let selection = update.startState.selection.main;
console.log("It's a URL and selection empty?", selection.empty);
if (!selection.empty) { if (!selection.empty) {
setTimeout(() => { setTimeout(() => {
update.view.dispatch({ update.view.dispatch({