diff --git a/plugs/markdown/markdown_render.ts b/plugs/markdown/markdown_render.ts index efed2c4..c6965d0 100644 --- a/plugs/markdown/markdown_render.ts +++ b/plugs/markdown/markdown_render.ts @@ -246,12 +246,17 @@ function render( case "WikiLink": { // console.log("WikiLink", JSON.stringify(t, null, 2)); const ref = findNodeOfType(t, "WikiLinkPage")!.children![0].text!; + let linkText = ref; + const aliasNode = findNodeOfType(t, "WikiLinkAlias"); + if (aliasNode) { + linkText = aliasNode.children![0].text!; + } return { name: "a", attrs: { href: `/${ref.replaceAll(" ", "_").replace("@", "#")}`, }, - body: ref, + body: linkText, }; } case "NakedURL": {