Skip to content

Commit fb48827

Browse files
authored
Merge pull request #1351 from RomanGotsiy/master
fix emphasis closing by single _ (part of left-flanking run)
2 parents 4dce02d + 9250947 commit fb48827

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/marked.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ var inline = {
541541
reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
542542
nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
543543
strong: /^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,
544-
em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,
544+
em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\s.])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\s.])|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,
545545
code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
546546
br: /^( {2,}|\\)\n(?!\s*$)/,
547547
del: noop,

test/specs/commonmark/commonmark-spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var messenger = new Messenger();
4545
|Backslash escapes | 10 of 13 | 77%|
4646
|Entity and numeric character references | 9 of 12 | 75%|
4747
|Code spans | 11 of 17 | 65%|
48-
|Emphasis and strong emphasis | 74 of 128 | 58%|
48+
|Emphasis and strong emphasis | 79 of 128 | 61%|
4949
|Links | 69 of 84 | 82%|
5050
|Images | 15 of 22 | 68%|
5151
|Autolinks | 15 of 19 | 79%|
@@ -338,7 +338,7 @@ describe('CommonMark 0.28 Emphasis and strong emphasis', function() {
338338
var section = 'Emphasis and strong emphasis';
339339

340340
// var shouldPassButFails = [];
341-
var shouldPassButFails = [334, 342, 348, 349, 352, 353, 354, 355, 356, 360, 368, 369, 371, 372, 378, 380, 381, 382, 387, 388, 392, 393, 394, 395, 396, 402, 403, 409, 416, 419, 420, 421, 422, 423, 424, 428, 431, 432, 433, 434, 435, 436, 443, 444, 445, 448, 449, 451, 453, 454, 455, 456, 457, 458];
341+
var shouldPassButFails = [334, 342, 348, 349, 352, 353, 360, 368, 369, 371, 372, 378, 380, 381, 382, 387, 388, 392, 393, 394, 395, 396, 402, 403, 409, 416, 419, 420, 421, 422, 423, 424, 428, 431, 432, 433, 434, 435, 436, 443, 444, 445, 448, 449, 453, 454, 455, 457, 458];
342342

343343
var willNotBeAttemptedByCoreTeam = [];
344344

0 commit comments

Comments
 (0)