cmark

My personal build of CMark ✏️

Commit
e829aaf75ff5feb57c9c0f1a0cd260903116752a
Parent
9dde9c96a7b7fb9810a60ae65dd2623b03b83da8
Author
John MacFarlane <jgm@berkeley.edu>
Date

Handle case with 4+ delimiters in a row.

Spec says to skip these.

Diffstat

1 file changed, 6 insertions, 1 deletion

Status File Name N° Changes Insertions Deletions
Modified js/stmd.js 7 6 1
diff --git a/js/stmd.js b/js/stmd.js
@@ -277,6 +277,11 @@ var parseEmphasis = function() {
   res = this.scanDelims(c);
   numdelims = res.numdelims;
 
+  if (numdelims >= 4) {
+      this.pos += numdelims;
+      return {t: 'Str', c: this.subject.slice(startpos, startpos + numdelims)};
+  }
+
   if (!res.can_open || numdelims === 0) {
     this.pos = startpos;
     return null;
@@ -349,7 +354,7 @@ var parseEmphasis = function() {
     }
     break;
 
-  default:
+  default: // shouldn't happen
   }
 
     return null;