Changes
7 changed files (+45/-45)
-
-
@@ -191,7 +191,7 @@ if (!replaced) {return SKIP; } // @ts-expect-error: unist-related libraries heavily relies on ambiend module declarations, // @ts-expect-error: unist-related libraries heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. parent.children[index] = replaced; },
-
-
-
@@ -9,7 +9,7 @@ return {enter: { ofmHighlight(token) { this.enter({ // @ts-expect-error: unist-related libraries heavily relies on ambiend module declarations, // @ts-expect-error: unist-related libraries heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. type: "ofmHighlight", children: [],
-
-
-
@@ -38,20 +38,20 @@function setSizeToNode(node: Mdast.Node, width: number, height: number | null) { node.data ??= {}; // @ts-expect-error: unist-related libraries heavily relies on ambiend module declarations, // @ts-expect-error: unist-related libraries heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. node.data.width = width; if (typeof height === "number") { // @ts-expect-error: unist-related libraries heavily relies on ambiend module declarations, // @ts-expect-error: unist-related libraries heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. node.data.height = height; } // @ts-expect-error: unist-related libraries heavily relies on ambiend module declarations, // @ts-expect-error: unist-related libraries heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. node.data.hProperties = { // @ts-expect-error: unist-related libraries heavily relies on ambiend module declarations, // @ts-expect-error: unist-related libraries heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. ...node.data.hProperties ?? {}, width,
-
-
-
@@ -25,7 +25,7 @@ return {enter: { ofmWikilink(token) { this.enter({ // @ts-expect-error: unist-related libraries heavily relies on ambiend module declarations, // @ts-expect-error: unist-related libraries heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. type: "ofmWikilink", target: "",
-
@@ -34,7 +34,7 @@ }, token);}, ofmWikilinkEmbed(token) { this.enter({ // @ts-expect-error: unist-related libraries heavily relies on ambiend module declarations, // @ts-expect-error: unist-related libraries heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. type: "ofmWikilinkEmbed", target: "",
-
-
-
@@ -32,14 +32,14 @@export function ofmHighlightHtml(): HtmlExtension { return { enter: { // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. [TokenTypeMap.highlight](this: CompileContext) { this.tag("<mark>"); }, }, exit: { // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. [TokenTypeMap.highlight](this: CompileContext) { this.tag("</mark>");
-
@@ -70,7 +70,7 @@ ) {return nok(code); } // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.enter(TokenTypeMap.sequenceTemporary); return more(code);
-
@@ -91,7 +91,7 @@ }// Since the character we are looking right now is no longer an equal sign, // we can exit temporary state and start consuming next phrasing-something-idk. // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. const token = effects.exit(TokenTypeMap.sequenceTemporary);
-
@@ -115,7 +115,7 @@ for (let i = 0; i < events.length; i++) {// If the event is not an end of temporary sequence we set on the tokenizer, skip. if ( events[i][0] !== "enter" || // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. events[i][1].type !== TokenTypeMap.sequenceTemporary || !events[i][1]._close
-
@@ -128,7 +128,7 @@ for (let j = i; j > 0; j--) {// If the event is not a start of temporary sequence we set on the tokenizer, skip. if ( events[j][0] !== "exit" || // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. events[j][1].type !== TokenTypeMap.sequenceTemporary || !events[j][1]._open
-
@@ -136,16 +136,16 @@ ) {continue; } // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. events[i][1].type = TokenTypeMap.sequence; // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. events[j][1].type = TokenTypeMap.sequence; // The whole highlight section, including sequences. const highlight: Token = { // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. type: TokenTypeMap.highlight, start: { ...events[j][1].start },
-
@@ -154,7 +154,7 @@ };// Text between highlight sequences. const text: Token = { // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. type: TokenTypeMap.highlightText, // text starts at the end of opening sequence, and
-
@@ -206,7 +206,7 @@for (const event of events) { // If there are temporary sequences left, alter them to `data` type. // (effectively making them invisible?, idk) // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. if (event[1].type === TokenTypeMap.sequenceTemporary) { event[1].type = types.data;
-
-
-
@@ -27,24 +27,24 @@export function ofmWikilinkHtml(): HtmlExtension { return { enter: { // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. [TokenTypeMap.wikilink](this: CompileContext) { this.tag(`<a href="`); }, [TokenTypeMap.embed](this: CompileContext) { // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. this.setData("wikilinkEmbed", true); }, [TokenTypeMap.target](this: CompileContext, token: Token) { const target = this.sliceSerialize(token); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. this.setData("wikilinkTarget", target); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. const isEmbed = this.getData("wikilinkEmbed"); if (isEmbed) {
-
@@ -56,11 +56,11 @@ },[TokenTypeMap.label](this: CompileContext, token: Token) { const label = this.sliceSerialize(token); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. this.setData("wikilinkLabel", label); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. const isEmbed = this.getData("wikilinkEmbed"); if (isEmbed) {
-
@@ -71,10 +71,10 @@ this.tag(label);}, }, exit: { // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. [TokenTypeMap.wikilink](this: CompileContext) { // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. const target: string | undefined = this.getData("wikilinkTarget"); if (!target) {
-
@@ -82,7 +82,7 @@ throw new Error("Empty Wikilink target found");} const label = this.getData( // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. "wikilinkLabel", ) as string | undefined;
-
@@ -93,7 +93,7 @@this.tag(`</a>`); }, [TokenTypeMap.embed](this: CompileContext) { // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. const target: string | undefined = this.getData("wikilinkTarget"); if (!target) {
-
@@ -101,7 +101,7 @@ throw new Error("Empty Wikilink target found");} const label = this.getData( // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. "wikilinkLabel", ) as string | undefined;
-
@@ -185,10 +185,10 @@ */const start: State = function (code) { if (code === codes.exclamationMark && previous !== codes.backslash) { type = TokenTypeMap.embed; // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.enter(type); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.enter(TokenTypeMap.start); effects.consume(code);
-
@@ -201,10 +201,10 @@ return nok(code);} if (type === TokenTypeMap.wikilink) { // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.enter(type); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.enter(TokenTypeMap.start); }
-
@@ -227,10 +227,10 @@ }effects.consume(code); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.exit(TokenTypeMap.start); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.enter(TokenTypeMap.target);
-
@@ -251,21 +251,21 @@ case codes.lineFeed:case codes.eof: return nok(code); case codes.verticalBar: // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.exit(TokenTypeMap.target); effects.consume(code); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.enter(TokenTypeMap.label); return label; // Empty wikilink is not allowed. case codes.rightSquareBracket: // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.exit(TokenTypeMap.target); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.enter(TokenTypeMap.end); effects.consume(code);
-
@@ -290,12 +290,12 @@ case codes.eof:return nok(code); // Empty wikilink is not allowed. case codes.rightSquareBracket: // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.exit(TokenTypeMap.label); effects.consume(code); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.enter(TokenTypeMap.end);
-
@@ -313,11 +313,11 @@ }effects.consume(code); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.exit(TokenTypeMap.end); // @ts-expect-error: micromark heavily relies on ambiend module declarations, // @ts-expect-error: micromark heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. effects.exit(type);
-
-
-
@@ -182,7 +182,7 @@ function ObsidianMarkdownBody({ content, document, tree, copyright, assets }: ObsidianMarkdownBodyProps, ) { const hast = toHast(content.content, { // @ts-expect-error: unist-related libraries heavily relies on ambiend module declarations, // @ts-expect-error: unist-related libraries heavily relies on ambient module declarations, // which Deno does not support. APIs also don't accept type parameters. handlers: { ...ofmCalloutToHastHandlers({
-