cmark

My personal build of CMark ✏️

Commit
daf49a0089b9f5e342d3f6ee077d7e284eeb5c1c
Parent
53d6785139fb9f4642d4bc3d48918fbf6f33621d
Author
John MacFarlane <jgm@berkeley.edu>
Date

blocks.js - avoid an implicit boolean cast.

Diffstat

1 file changed, 3 insertions, 3 deletions

Status File Name N° Changes Insertions Deletions
Modified js/lib/blocks.js 6 3 3
diff --git a/js/lib/blocks.js b/js/lib/blocks.js
@@ -65,10 +65,10 @@ var detabLine = function(text) {
 // Return index of match or -1.
 var matchAt = function(re, s, offset) {
     var res = s.slice(offset).match(re);
-    if (res) {
-        return offset + res.index;
-    } else {
+    if (res === null) {
         return -1;
+    } else {
+        return offset + res.index;
     }
 };