summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-10-26 12:37:59 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-10-26 12:37:59 -0700
commite618715636a3bd60930bea34d214b3aaf8e9e766 (patch)
treeea550ce33d20532de1d240c083f997805aeb54d6 /js
parent9918827edd3dd6630f7417f1efca673bae55e6dd (diff)
Require space before closing # sequence in ATX header.
Closes #169.
Diffstat (limited to 'js')
-rw-r--r--js/lib/blocks.js2
1 files changed, 1 insertions, 1 deletions
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,}(?!.*~)/))) {