Skip to content

Commit 9922b1b

Browse files
committed
fix: embedded link regexes were too greedy
1 parent 8350113 commit 9922b1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plugins/embedTweaks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const gifEmbed: IPlugin = {
66
{
77
// I once saw a gif coming from Notion that wasn't a full
88
// url, which wouldn't work, hence the "http" requirement
9-
regex: /\[.*\]\((http.*(\.(gif|GIF)))\)/,
9+
regex: /\[.*?\]\((http.*?(\.(gif|GIF)))\)/,
1010
replacementPattern: `![]($1)`,
1111
},
1212
],
@@ -16,7 +16,7 @@ export const imgurGifEmbed: IPlugin = {
1616
name: "imgur",
1717
regexMarkdownModifications: [
1818
{
19-
regex: /\[.*\]\((.*imgur\.com\/.*)\)/, // imgur.com
19+
regex: /\[.*?\]\((.*?imgur\.com\/.*?)\)/, // imgur.com
2020
// imgur links to gifs need a .gif at the end, but the url they give you doesn't have one.
2121
replacementPattern: `![]($1.gif)`,
2222
},

0 commit comments

Comments
 (0)