Skip to content

Commit

Permalink
Merge pull request #273 from cnblogs/272-fix-regex-for-markdown-images
Browse files Browse the repository at this point in the history
fix: regex for matching markdown images
  • Loading branch information
cnblogs-dudu authored Dec 9, 2023
2 parents 92fb7f7 + bd00f88 commit cd9663a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/service/extract-img/find-img-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const imgTagDataUrlImgPat = r`(<img.*?src\s*=\s*")(${dataUrlPat})"[^/]*?\/?>`
const imgTagUrlImgPat = r`(<img\s*.*?src\s*=\s*["'])(.*?)["'][^>]*?>`
const mkdDataUrlImgPat = r`(!\[.*?]\()(${dataUrlPat})\)`

const markdownImages = /(?<prefix>!\[[^\]]*\]\()(?<uri>[^)\s]+)[^)]*\)/g
const markdownImages = /(?<prefix>!\[[^\]]*\]\()(?<uri>[^)]+)\)/g
const wikilinkImages = /!\[(\[.+?\])\][\s\S]+?(?<prefix>\1:\s*)(?<uri>.*?)\s+/g
const exludeDomains = /\.cnblogs\.com/i
const webUrlPrefix = /^https?:\/\//i
Expand Down

0 comments on commit cd9663a

Please sign in to comment.