From 0c737c10ba28eaad3085b23998542aad3f77e88e Mon Sep 17 00:00:00 2001 From: Waylon Flinn Date: Fri, 22 Apr 2016 12:05:08 -0500 Subject: [PATCH] don't match empty inline block --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index ce3a877..897a183 100644 --- a/index.js +++ b/index.js @@ -61,6 +61,12 @@ function math_inline(state, silent){ return false; } + if (start + 1 === state.pos) { + // There is nothing between the delimiters -- don't match. + state.pos = start; + return false; + } + //found the closing delimiter and state.pos is pointing it token = state.push('math_inline','math',0); token.content = state.src.slice(start+1,state.pos).trim();