Cleanup
parent
5dbe71568e
commit
17d4553fa9
|
@ -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
|
||||||
|
|
|
@ -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({
|
||||||
|
|
Loading…
Reference in New Issue