Skip to content

Commit

Permalink
🔗 Link text transform should be idempotent (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 authored Nov 10, 2023
1 parent d1987ea commit 5bc1e96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-spoons-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'myst-transforms': patch
---

Link text transform is run twice and should be idempotent
1 change: 1 addition & 0 deletions packages/myst-transforms/src/links/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function formatLinkText(link: Link) {
const url = link.children[0].value;
// Add an exception for wiki transforms links.
if (url.length < 20 || url.match(/\s/) || url.startsWith('wiki:')) return;
if (url.includes('​')) return;
// Split the URL into an array to distinguish double slashes from single slashes
const doubleSlash = url.split('//');
// Format the strings on either side of double slashes separately
Expand Down

0 comments on commit 5bc1e96

Please sign in to comment.