From c7f6383e34c30b63e0e0b86f320f42f2c9a0bdb7 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 3 Sep 2025 16:55:19 -0300 Subject: content, replacer: match inline links, auto-provide custom label Changes in matchMarkdownLinks here are refactoring only, not new behavior. --- src/content/dependencies/transformContent.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/content') diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js index e9a75744..a6639acd 100644 --- a/src/content/dependencies/transformContent.js +++ b/src/content/dependencies/transformContent.js @@ -601,9 +601,12 @@ export default { } case 'external-link': { - const {label} = node.data; const externalLink = relations.externalLinks[externalLinkIndex++]; + const label = + node.data.label ?? + node.data.href.replace(/^https?:\/\//, ''); + if (slots.textOnly) { return {type: 'text', data: label}; } -- cgit 1.3.0-6-gf8a5