Fix alias page link markdown rendering
This commit is contained in:
parent
45b84ab05b
commit
b43c028e51
@ -246,12 +246,17 @@ function render(
|
|||||||
case "WikiLink": {
|
case "WikiLink": {
|
||||||
// console.log("WikiLink", JSON.stringify(t, null, 2));
|
// console.log("WikiLink", JSON.stringify(t, null, 2));
|
||||||
const ref = findNodeOfType(t, "WikiLinkPage")!.children![0].text!;
|
const ref = findNodeOfType(t, "WikiLinkPage")!.children![0].text!;
|
||||||
|
let linkText = ref;
|
||||||
|
const aliasNode = findNodeOfType(t, "WikiLinkAlias");
|
||||||
|
if (aliasNode) {
|
||||||
|
linkText = aliasNode.children![0].text!;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
name: "a",
|
name: "a",
|
||||||
attrs: {
|
attrs: {
|
||||||
href: `/${ref.replaceAll(" ", "_").replace("@", "#")}`,
|
href: `/${ref.replaceAll(" ", "_").replace("@", "#")}`,
|
||||||
},
|
},
|
||||||
body: ref,
|
body: linkText,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
case "NakedURL": {
|
case "NakedURL": {
|
||||||
|
Loading…
Reference in New Issue
Block a user