From 2fc6c0d06f4199f4e7ee6fb0e46337bfc6749d24 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 11 Sep 2014 09:10:03 -0700 Subject: Add check for null in last_emphasis_closer. --- js/stmd.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/stmd.js b/js/stmd.js index fab3a51..1b82fd5 100755 --- a/js/stmd.js +++ b/js/stmd.js @@ -299,7 +299,8 @@ var parseEmphasis = function() { res = this.scanDelims(c); numclosedelims = res.numdelims; if (res.can_close) { - if (last_emphasis_closer < this.pos) { + if (last_emphasis_closer === null || + last_emphasis_closer < this.pos) { last_emphasis_closer = this.pos; } if (numclosedelims === 3 && delims_to_match === 3) { -- cgit v1.2.3