Fix alias page link markdown rendering
This commit is contained in:
parent
45b84ab05b
commit
b43c028e51
@ -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": {
|
||||
|
Loading…
Reference in New Issue
Block a user