Skip to content

Commit

Permalink
refactor: remove redundant character escape from regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
gavvvr committed Oct 12, 2023
1 parent f6a2971 commit bbb6f59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/imgur/resizing/md-image-parsing.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import MarkdownImagePieces, { mdImagePiecesFrom } from './MarkdownImagePieces'

const imgurImageRegexp =
/(\[)?(!\[[^[\]]*\]\()(https?:\/\/(?:i\.)?imgur\.com\/)(\w+)\.(png|jpe?g|gif)\)(]\(https?:\/\/(?:i\.)?imgur\.com\/\w+\.(?:png|jpe?g|gif)\))?/gm
/(\[)?(!\[[^[\]]*]\()(https?:\/\/(?:i\.)?imgur\.com\/)(\w+)\.(png|jpe?g|gif)\)(]\(https?:\/\/(?:i\.)?imgur\.com\/\w+\.(?:png|jpe?g|gif)\))?/gm

const parseImgurImages = (line: string): IterableIterator<RegExpMatchArray> =>
line.matchAll(imgurImageRegexp)
Expand Down

0 comments on commit bbb6f59

Please sign in to comment.