diff --git a/plugs/editor/navigate.ts b/plugs/editor/navigate.ts index bc952191..bdf05515 100644 --- a/plugs/editor/navigate.ts +++ b/plugs/editor/navigate.ts @@ -18,7 +18,6 @@ async function actionClickOrActionEnter( if (!mdTree) { return; } - // console.log("Got a click on", mdTree); const navigationNodeFinder = (t: ParseTree) => [ "WikiLink", @@ -61,7 +60,7 @@ async function actionClickOrActionEnter( if (pageRef.pos === undefined) { pageRef.pos = 0; } - return editor.navigate(pageRef, false); + return editor.navigate(pageRef, false, inNewWindow); } } case "PageRef": { @@ -89,6 +88,8 @@ async function actionClickOrActionEnter( } else { return editor.navigate( parsePageRef(resolvePath(currentPage, decodeURI(url))), + false, + inNewWindow, ); } } else { diff --git a/web/cm_plugins/markdown_widget.ts b/web/cm_plugins/markdown_widget.ts index 1beed3ea..6a92d4e2 100644 --- a/web/cm_plugins/markdown_widget.ts +++ b/web/cm_plugins/markdown_widget.ts @@ -174,7 +174,7 @@ export class MarkdownWidget extends WidgetType { e.preventDefault(); e.stopPropagation(); const pageRef = parsePageRef(el.dataset.ref!); - this.client.navigate(pageRef); + this.client.navigate(pageRef, false, e.ctrlKey || e.metaKey); }); }); diff --git a/web/cm_plugins/wiki_link.ts b/web/cm_plugins/wiki_link.ts index a694126e..fb4c1fb4 100644 --- a/web/cm_plugins/wiki_link.ts +++ b/web/cm_plugins/wiki_link.ts @@ -5,7 +5,6 @@ import { Client } from "../client.ts"; import { decoratorStateField, isCursorInRange, LinkWidget } from "./util.ts"; import { resolvePath } from "$sb/lib/resolve.ts"; import { encodePageRef, parsePageRef } from "$sb/lib/page_ref.ts"; -import { wikiLinkRegex } from "$common/markdown_parser/parser.ts"; /** * Plugin to hide path prefix when the cursor is not inside.