Skip to content

Commit

Permalink
fix: #923 支持多个括号
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Sep 25, 2024
1 parent 4466bc1 commit a3da98b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/hooks/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default class Image extends SyntaxBase {
`${
'(?:' +
'\\(' +
'((?:[^\\s()]*\\([^\\s()]*\\)[^\\s()]*)|(?:[^"][^\\s]+?))' + // ?<link> url
'((?:[^\\s()]*\\([^\\s()]*\\)[^\\s()]*)+|(?:[^"][^\\s]+?))' + // ?<link> url
'(?:[ \\t]((?:".*?")|(?:\'.*?\')))?' + // ?<title> optional
'\\)' +
'|' + // or
Expand Down
2 changes: 1 addition & 1 deletion src/core/hooks/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default class Link extends SyntaxBase {
* [link](()) ⭕️ valid
* [link](" ") ❌ invalid
*/
'((?:[^\\s()]*\\([^\\s()]*\\)[^\\s()]*)|[^\\s)]+)' + // ?<link> url
'((?:[^\\s()]*\\([^\\s()]*\\)[^\\s()]*)+|[^\\s)]+)' + // ?<link> url
'(?:[ \\t]((?:".*?")|(?:\'.*?\')))?' + // ?<title> optional
'\\)' +
'|' + // or
Expand Down

0 comments on commit a3da98b

Please sign in to comment.