summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-09-11 09:10:03 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-09-11 11:17:41 -0700
commit2fc6c0d06f4199f4e7ee6fb0e46337bfc6749d24 (patch)
tree306343dd1d0f16913bffc32206cecb0a5bad6d77
parentc11c900b618f6ca48f37ff1bdd2b9602317ec177 (diff)
Add check for null in last_emphasis_closer.
-rwxr-xr-xjs/stmd.js3
1 files changed, 2 insertions, 1 deletions
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) {