cmark

My personal build of CMark ✏️

Commit
0275f344ae13b09be13c37ffeb525af067116ff6
Parent
25a1a57fe5350a2b89f8d9726b95f8e48fee83d7
Author
John MacFarlane <jgm@berkeley.edu>
Date

stmd.js: Fixed ATX header parser bug.

Don't count an escaped # at the end as a closing string of #s. Closes #16.

Diffstat

1 file changed, 1 insertion, 1 deletion

Status File Name N° Changes Insertions Deletions
Modified js/stmd.js 2 1 1
diff --git a/js/stmd.js b/js/stmd.js
@@ -1064,7 +1064,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(/(?:(\\#) *#*| *#+) *$/,'$1')];
       break;
 
     } else if ((match = ln.slice(first_nonspace).match(/^`{3,}(?!.*`)|^~{3,}(?!.*~)/))) {