Rewrote all plugs using MarkdownTree

This commit is contained in:
Zef Hemel
2022-04-04 11:51:41 +02:00
parent 07453d638b
commit 16577c8ea2
17 changed files with 332 additions and 255 deletions
+5 -11
View File
@@ -1,14 +1,8 @@
import { styleTags, tags as t } from "@codemirror/highlight";
import {
BlockContext,
LeafBlock,
LeafBlockParser,
MarkdownConfig,
TaskList,
} from "@lezer/markdown";
import { commonmark, mkLang } from "./markdown/markdown";
import {styleTags, tags as t} from "@codemirror/highlight";
import {BlockContext, LeafBlock, LeafBlockParser, MarkdownConfig, TaskList,} from "@lezer/markdown";
import {commonmark, mkLang} from "./markdown/markdown";
import * as ct from "./customtags";
import { pageLinkRegex } from "./constant";
import {pageLinkRegex} from "./constant";
const pageLinkRegexPrefix = new RegExp(
"^" + pageLinkRegex.toString().slice(1, -1)
@@ -28,7 +22,7 @@ const WikiLink: MarkdownConfig = {
return -1;
}
return cx.addElement(
cx.elt("WikiLink", pos, pos + match[0].length + 1, [
cx.elt("WikiLink", pos, pos + match[0].length, [
cx.elt("WikiLinkPage", pos + 2, pos + match[0].length - 2),
])
);