From d0aa0b1a08c2c7b539c9865e7ddef6a4a8f0de1f Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 8 Dec 2018 13:01:36 +0100 Subject: [PATCH] allow the closing fence to be longer that the opening one (pass cm example 93) --- lib/marked.js | 2 +- test/specs/commonmark/commonmark-spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index ba460fb2..01bd9abe 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -91,7 +91,7 @@ block.normal = merge({}, block); */ block.gfm = merge({}, block.normal, { - fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n(?:|([\s\S]*?)\n) *\1 *(?:\n+|$)/, + fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n(?:|([\s\S]*?)\n) *\1[~`]* *(?:\n+|$)/, paragraph: /^/, heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ }); diff --git a/test/specs/commonmark/commonmark-spec.js b/test/specs/commonmark/commonmark-spec.js index 7cca2d83..5f8faa94 100644 --- a/test/specs/commonmark/commonmark-spec.js +++ b/test/specs/commonmark/commonmark-spec.js @@ -160,7 +160,7 @@ describe('CommonMark 0.28 Fenced code blocks', function() { var section = 'Fenced code blocks'; // var shouldPassButFails = []; - var shouldPassButFails = [93, 95, 96, 97, 106, 108, 112]; + var shouldPassButFails = [95, 96, 97, 106, 108, 112]; var willNotBeAttemptedByCoreTeam = [];