diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-09-03 16:55:19 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-09-03 16:56:06 -0300 |
commit | c7f6383e34c30b63e0e0b86f320f42f2c9a0bdb7 (patch) | |
tree | 9fe61e6ccb8afd6c474cf667634d2c7f504247a0 /src/content | |
parent | 0c70a112914f7eb4bea0d839d44060cb30f4f30e (diff) |
content, replacer: match inline links, auto-provide custom label
Changes in matchMarkdownLinks here are refactoring only, not new behavior.
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/dependencies/transformContent.js | 5 |
1 files changed, 4 insertions, 1 deletions
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}; } |