fix: fix non-breaking space in link url (#3667)

This commit is contained in:
Tony Brix 2025-04-23 14:53:45 -06:00 committed by GitHub
parent c37336c241
commit e071e25d13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 6 deletions

View File

@ -338,9 +338,9 @@ const tag = edit(
const _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
const link = edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/)
const link = edit(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/)
.replace('label', _inlineLabel)
.replace('href', /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/)
.replace('href', /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/)
.replace('title', /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/)
.getRegex();

View File

@ -4056,8 +4056,7 @@
"example": 507,
"start_line": 7776,
"end_line": 7780,
"section": "Links",
"shouldFail": true
"section": "Links"
},
{
"markdown": "[link](/url \"title \"and\" title\")\n",

View File

@ -4056,8 +4056,7 @@
"example": 507,
"start_line": 7776,
"end_line": 7780,
"section": "Links",
"shouldFail": true
"section": "Links"
},
{
"markdown": "[link](/url \"title \"and\" title\")\n",