Skip to content

Commit

Permalink
fix(remove-redirect): 修复推特(Twitter)链接转换错误
Browse files Browse the repository at this point in the history
  • Loading branch information
maomao1996 committed May 10, 2024
1 parent 479c824 commit 0f89828
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/khaki-balloons-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'remove-redirect': patch
---

修复推特(Twitter)链接转换错误
2 changes: 1 addition & 1 deletion packages/remove-redirect/src/sites/twitter.com.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 0f89828

Please sign in to comment.