From 2cf0750a7a507eded4cf3c9a48fd1f924d0ce538 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 7 Sep 2014 08:06:35 -0700 Subject: Fixed #48. - Fixed js and C code. - Added two test cases to spec. --- js/stmd.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'js') diff --git a/js/stmd.js b/js/stmd.js index 13bdbd6..15d7345 100755 --- a/js/stmd.js +++ b/js/stmd.js @@ -341,16 +341,15 @@ var parseEmphasis = function(inlines) { res = this.scanDelims(c); if (res.numdelims >= 1 && res.numdelims <= 3 && res.can_close && res.numdelims != first_close_delims) { - if (res.numdelims === 3) { - // If we opened with ***, then we interpret *** as ** followed by * - // giving us - res.numdelims = 1; - } - if (first_close_delims === 1) { + if (first_close_delims === 1 && numdelims > 2) { res.numdelims = 2; } else if (first_close_delims === 2) { res.numdelims = 1; + } else if (res.numdelims === 3) { + // If we opened with ***, then we interpret *** as ** followed by * + // giving us + res.numdelims = 1; } this.pos += res.numdelims; -- cgit v1.2.3