Skip to content

Commit

Permalink
fix(link): fix the problem that the link does not render when the url…
Browse files Browse the repository at this point in the history
… length is less than 3 (#218)
  • Loading branch information
lyngai authored May 23, 2022
1 parent 9f227e1 commit ed2e0a2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/hooks/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,14 @@ export default class Link extends SyntaxBase {
`${
'(?:' +
'\\(' +
'([^"][^\\s)]+?[^"])' + // ?<link> url
/**
* allow double quotes
* e.g.
* [link](") ⭕️ valid
* [link]("") ⭕️ valid
* [link](" ") ❌ invalid
*/
'([^\\s)]+)' + // ?<link> url
'(?:[ \\t]((?:".*?")|(?:\'.*?\')))?' + // ?<title> optional
'\\)' +
'|' + // or
Expand Down

0 comments on commit ed2e0a2

Please sign in to comment.