cmark

My personal build of CMark ✏️

Commit
3bb150e5e689a6e58d485f2b87c15e38ccf50ae7
Parent
958505853ebd24fd3c0dc2bc6f6fb0615a48c8b7
Author
John MacFarlane <jgm@berkeley.edu>
Date

Timings: added 'preparing input'.

Diffstat

1 file changed, 3 insertions, 1 deletion

Status File Name N° Changes Insertions Deletions
Modified js/lib/blocks.js 4 3 1
diff --git a/js/lib/blocks.js b/js/lib/blocks.js
@@ -671,16 +671,18 @@ var Document = function() {
 // The main parsing function.  Returns a parsed document AST.
 var parse = function(input) {
     "use strict";
-    if (this.options.time) { console.time("block parsing"); }
     this.doc = Document();
     this.tip = this.doc;
     this.refmap = {};
+    if (this.options.time) { console.time("preparing input"); }
     var lines = input.split(reLineEnding);
     var len = lines.length;
     if (input.charCodeAt(input.length - 1) === C_NEWLINE) {
         // ignore last blank line created by final newline
         len -= 1;
     }
+    if (this.options.time) { console.timeEnd("preparing input"); }
+    if (this.options.time) { console.time("block parsing"); }
     for (var i = 0; i < len; i++) {
         this.incorporateLine(lines[i], i + 1);
     }