Skip to content

Commit 9c976cd

Browse files
committed
enable CommonMark spec 468
A minor adjustment to the href-matching regexp permits CommonMark spec 468 to pass. All other passing specs are unaffected. The regexp was incorrectly excluding parentheses as valid characters in a URL.
1 parent b67b5fd commit 9c976cd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/marked.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ inline.tag = edit(inline.tag)
544544
.getRegex();
545545

546546
inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/;
547-
inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/;
547+
inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/;
548548
inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
549549

550550
inline.link = edit(inline.link)

test/specs/commonmark/commonmark-spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ describe('CommonMark 0.28 Links', function() {
349349
var section = 'Links';
350350

351351
// var shouldPassButFails = [];
352-
var shouldPassButFails = [468, 474, 478, 483, 489, 490, 491, 492, 495, 496, 497, 499, 503, 504, 505, 507, 508, 509, 523, 535];
352+
var shouldPassButFails = [474, 478, 483, 489, 490, 491, 492, 495, 496, 497, 499, 503, 504, 505, 507, 508, 509, 523, 535];
353353

354354
var willNotBeAttemptedByCoreTeam = [];
355355

0 commit comments

Comments
 (0)