From e618715636a3bd60930bea34d214b3aaf8e9e766 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 26 Oct 2014 12:37:59 -0700 Subject: Require space before closing # sequence in ATX header. Closes #169. --- js/lib/blocks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/lib/blocks.js b/js/lib/blocks.js index 109661f..175cc2a 100644 --- a/js/lib/blocks.js +++ b/js/lib/blocks.js @@ -366,7 +366,7 @@ var incorporateLine = function(ln, line_number) { container.level = match[0].trim().length; // number of #s // remove trailing ###s: container.strings = - [ln.slice(offset).replace(/(?:(\\#) *#*| *#+) *$/,'$1')]; + [ln.slice(offset).replace(/^ *#+ *$/, '').replace(/ +#+ *$/,'')]; break; } else if ((match = ln.slice(first_nonspace).match(/^`{3,}(?!.*`)|^~{3,}(?!.*~)/))) { -- cgit v1.2.3