Skip to content

Commit cad2edd

Browse files
authored
Merge pull request #10 from lcdsmao/lcdsmao-support-gif
Support gif extension
2 parents 9be7ac9 + 932504d commit cad2edd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/js/convert-to-img-tag.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ function convertToImgTag(text, params) {
3030

3131
function createMarkdownImages(text, params) {
3232
let markdownImageArray = []
33-
const results = text.match(/\!\[.*\]\(https:\/\/\S+(jpg|jpeg|png)\)/gmi)
33+
const results = text.match(/\!\[.*\]\(https:\/\/\S+(jpg|jpeg|png|gif)\)/gmi)
3434
if (results == null) { return null}
3535

3636
for (const mdImage of results) {
37-
const imageURL = mdImage.match(/https:\S+(jpg|jpeg|png)/i)[0]
37+
const imageURL = mdImage.match(/https:\S+(jpg|jpeg|png|gif)/i)[0]
3838
const imageTag = `<img src=${imageURL} ${params}>`
3939
const markdownImage = new MarkdownImage(imageURL, mdImage, imageTag)
4040
markdownImageArray.push(markdownImage)
@@ -58,4 +58,4 @@ function createParams(storage) {
5858
}
5959

6060
return result
61-
}
61+
}

0 commit comments

Comments
 (0)