Change anchor reference syntax
This commit is contained in:
@@ -13,7 +13,7 @@ export async function brokenLinksCommand() {
|
||||
traverseTree(tree, (tree) => {
|
||||
if (tree.type === "WikiLinkPage") {
|
||||
// Add the prefix in the link text
|
||||
const [pageName] = tree.children![0].text!.split("@");
|
||||
const [pageName] = tree.children![0].text!.split(/[@$]/);
|
||||
if (pageName.startsWith("!")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { cacheFileListing } from "../federation/federation.ts";
|
||||
|
||||
// Completion
|
||||
export async function pageComplete(completeEvent: CompleteEvent) {
|
||||
const match = /\[\[([^\]@:\{}]*)$/.exec(completeEvent.linePrefix);
|
||||
const match = /\[\[([^\]@$:\{}]*)$/.exec(completeEvent.linePrefix);
|
||||
if (!match) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ async function actionClickOrActionEnter(
|
||||
case "WikiLink": {
|
||||
let pageLink = mdTree.children![1]!.children![0].text!;
|
||||
let pos;
|
||||
if (pageLink.includes("@")) {
|
||||
[pageLink, pos] = pageLink.split("@");
|
||||
if (pageLink.includes("@") || pageLink.includes("$")) {
|
||||
[pageLink, pos] = pageLink.split(/[@$]/);
|
||||
if (pos.match(/^\d+$/)) {
|
||||
pos = +pos;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user