Skip to content

Commit 00e7f4d

Browse files
committed
Fix regex error
1 parent ca6ee62 commit 00e7f4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crawler/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class Crawler {
120120
}
121121

122122
async getImage(body) {
123-
const regex = /!\[[^\]]*\]\((.*?.png|.jpeg|.jpg|.webp|.svg|.gif|.tiff)\s*("(?:.*[^"])")?\s*\)|!\[[^\]]*\]\((.*?)\s*("(?:.*[^"])")?\s*\)/g;
123+
const regex = /!\[[^\]]*\]\((.*?.png|.*?.jpeg|.*?.jpg|.*?.webp|.*?.svg|.*?.gif|.*?.tiff)\s*("(?:.*[^"])")?\s*\)|!\[[^\]]*\]\((.*?)\s*("(?:.*[^"])")?\s*\)/g;
124124

125125
body = body.replace(regex, (_, url) => {
126126
if (!url) return;

0 commit comments

Comments
 (0)