Skip to content

Commit ded5e24

Browse files
committed
update link
1 parent 7faa999 commit ded5e24

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/marked.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ var inline = {
542542
+ '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
543543
+ '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
544544
+ '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
545-
link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,
545+
link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
546546
reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
547547
nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
548548
strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,
@@ -574,8 +574,8 @@ inline.tag = edit(inline.tag)
574574
.replace('attribute', inline._attribute)
575575
.getRegex();
576576

577-
inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/;
578-
inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/;
577+
inline._label = /(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
578+
inline._href = /<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/;
579579
inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
580580

581581
inline.link = edit(inline.link)

0 commit comments

Comments
 (0)