From d76475721cb890fa6065f23f866d25063bb868cb Mon Sep 17 00:00:00 2001 From: Vitaly Puzrin Date: Sun, 8 Mar 2015 16:10:22 +0300 Subject: [PATCH] typo fix --- lib/rules_inline/emphasis.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/rules_inline/emphasis.js b/lib/rules_inline/emphasis.js index 1be2cc7..b90971d 100644 --- a/lib/rules_inline/emphasis.js +++ b/lib/rules_inline/emphasis.js @@ -22,7 +22,11 @@ function scanDelims(state, start) { lastChar = start > 0 ? state.src.charCodeAt(start - 1) : -1; while (pos < max && state.src.charCodeAt(pos) === marker) { pos++; } - if (pos >= max) { can_open = false; } + + if (pos >= max) { + can_open = false; + } + count = pos - start; nextChar = pos < max ? state.src.charCodeAt(pos) : -1; @@ -149,22 +153,22 @@ module.exports = function emphasis(state, silent) { // now trying to serialize them into tokens for (count = startCount; count > 1; count -= 2) { token = state.push('strong_open', 'strong', 1); - token.marker = String.fromCharCode(marker) + String.fromCharCode(marker); + token.markup = String.fromCharCode(marker) + String.fromCharCode(marker); } if (count % 2) { token = state.push('em_open', 'em', 1); - token.marker = String.fromCharCode(marker); + token.markup = String.fromCharCode(marker); } state.md.inline.tokenize(state); if (count % 2) { - state.push('em_close', 'em', -1); - token.marker = String.fromCharCode(marker) + String.fromCharCode(marker); + token = state.push('em_close', 'em', -1); + token.markup = String.fromCharCode(marker) + String.fromCharCode(marker); } for (count = startCount; count > 1; count -= 2) { - state.push('strong_close', 'strong', -1); - token.marker = String.fromCharCode(marker); + token = state.push('strong_close', 'strong', -1); + token.markup = String.fromCharCode(marker); } state.pos = state.posMax + startCount;