Browse Source

typo fix

pull/82/head
Vitaly Puzrin 9 years ago
parent
commit
d76475721c
  1. 18
      lib/rules_inline/emphasis.js

18
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;

Loading…
Cancel
Save