From f9b8c6adf223f1ad53f487836680255469723422 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Wed, 26 Nov 2025 01:12:42 +0800 Subject: [PATCH] refactor(theme): refactor link detector, close #754 (#756) * refactor(theme): refactor link detector * chore: tweak --- .../plugin-md-power/src/node/enhance/links.ts | 1 + theme/src/client/components/VPLink.vue | 2 +- theme/src/client/composables/link.ts | 42 ++++++++++++++----- theme/src/client/styles/content.css | 3 +- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/plugins/plugin-md-power/src/node/enhance/links.ts b/plugins/plugin-md-power/src/node/enhance/links.ts index 91f2a7ff..0920612c 100644 --- a/plugins/plugin-md-power/src/node/enhance/links.ts +++ b/plugins/plugin-md-power/src/node/enhance/links.ts @@ -44,6 +44,7 @@ export function linksPlugin(md: Markdown): void { // convert starting tag of internal link hasOpenInternalLink = true token.tag = internalTag + token.attrJoin(':no-icon', 'true') const matched = hrefLink.match(/^([^#?]*?(?:\/|\.md|\.html))([#?].*)?$/) diff --git a/theme/src/client/components/VPLink.vue b/theme/src/client/components/VPLink.vue index c3616c44..f4899a68 100644 --- a/theme/src/client/components/VPLink.vue +++ b/theme/src/client/components/VPLink.vue @@ -29,7 +29,7 @@ function linkTo(e: Event) {