From e829aaf75ff5feb57c9c0f1a0cd260903116752a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 8 Sep 2014 15:56:04 -0700 Subject: Handle case with 4+ delimiters in a row. Spec says to skip these. --- js/stmd.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/stmd.js b/js/stmd.js index cfd5051..4b3d994 100755 --- a/js/stmd.js +++ b/js/stmd.js @@ -277,6 +277,11 @@ var parseEmphasis = function() { res = this.scanDelims(c); numdelims = res.numdelims; + if (numdelims >= 4) { + this.pos += numdelims; + return {t: 'Str', c: this.subject.slice(startpos, startpos + numdelims)}; + } + if (!res.can_open || numdelims === 0) { this.pos = startpos; return null; @@ -349,7 +354,7 @@ var parseEmphasis = function() { } break; - default: + default: // shouldn't happen } return null; -- cgit v1.2.3