From 0f898285439c49cb91e34ec16cfe73fa7ba540d2 Mon Sep 17 00:00:00 2001 From: maomao <1714487678@qq.com> Date: Fri, 10 May 2024 15:20:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(remove-redirect):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=8E=A8=E7=89=B9=EF=BC=88Twitter=EF=BC=89=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/khaki-balloons-call.md | 5 +++++ packages/remove-redirect/src/sites/twitter.com.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/khaki-balloons-call.md diff --git a/.changeset/khaki-balloons-call.md b/.changeset/khaki-balloons-call.md new file mode 100644 index 0000000..33402ef --- /dev/null +++ b/.changeset/khaki-balloons-call.md @@ -0,0 +1,5 @@ +--- +'remove-redirect': patch +--- + +修复推特(Twitter)链接转换错误 diff --git a/packages/remove-redirect/src/sites/twitter.com.ts b/packages/remove-redirect/src/sites/twitter.com.ts index 69c3912..334b8a4 100644 --- a/packages/remove-redirect/src/sites/twitter.com.ts +++ b/packages/remove-redirect/src/sites/twitter.com.ts @@ -13,7 +13,7 @@ const sites: SiteModule = [ transform: { selector: 'a[href*="://t.co/"]', customTransform(node) { - const originUrl = node.innerText + const originUrl = node.innerText.replace('…', '') if (validateUrl(originUrl)) { node.setAttribute('href', originUrl) }