From 3e26ff54500e0cbb136d534ec20f7b46afec6bac Mon Sep 17 00:00:00 2001 From: Tarrgon <61888458+Tarrgon@users.noreply.github.com> Date: Thu, 25 Jun 2026 22:44:30 -0400 Subject: [PATCH] Format inline links properly --- src/utils/dtext-utils.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/utils/dtext-utils.ts b/src/utils/dtext-utils.ts index de03193..0ba2ecd 100644 --- a/src/utils/dtext-utils.ts +++ b/src/utils/dtext-utils.ts @@ -64,6 +64,17 @@ export async function parseDTextToMarkdown(text: string): Promise { } } else if (node.linkType == 'url') { 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 { out.push('['); markdownHandlers.link(node, out, ctx);