Skip to content

Commit f606d47

Browse files
committed
better regex replacement
1 parent 99d5146 commit f606d47

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

script/content-migrations/update-developer-site-links.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ async function main () {
6565
// first replace the old link with the new link
6666
// then remove any trailing slashes
6767
newContent = newContent
68-
.replace(devLink, newLink)
69-
.replace(`${newLink}/`, newLink)
68+
.replace(new RegExp(`${devLink}/?(?=\\))`), newLink)
7069
}
7170

7271
fs.writeFileSync(file, frontmatter.stringify(newContent, data, { lineWidth: 10000 }))

0 commit comments

Comments
 (0)