Format inline links properly

This commit is contained in:
Tarrgon
2026-06-25 22:44:30 -04:00
parent 73c8a38db3
commit 3e26ff5450
+11
View File
@@ -64,6 +64,17 @@ export async function parseDTextToMarkdown(text: string): Promise<string> {
} }
} else if (node.linkType == 'url') { } else if (node.linkType == 'url') {
out.push(`${node.href.startsWith('/') ? config.E621_BASE_URL : ''}${node.href}`); out.push(`${node.href.startsWith('/') ? config.E621_BASE_URL : ''}${node.href}`);
} else if (node.linkType == 'inline') {
out.push('[');
if (node.children) {
for (const child of node.children) {
ctx.render(child, out);
}
} else {
out.push('-NO TITLE-');
}
out.push(']');
out.push(`(${node.href.startsWith('/') ? config.E621_BASE_URL : ''}${node.href})`);
} else { } else {
out.push('['); out.push('[');
markdownHandlers.link(node, out, ctx); markdownHandlers.link(node, out, ctx);