From bf4ba212542ccb6567403d0beafcb6990da1e76f Mon Sep 17 00:00:00 2001 From: Ullallulloo Date: Sat, 27 May 2017 13:33:45 -0500 Subject: [PATCH] Fixed typos in comment --- lib/parser_block.js | 2 +- lib/rules_block/list.js | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/parser_block.js b/lib/parser_block.js index 2170fd2..97afabf 100644 --- a/lib/parser_block.js +++ b/lib/parser_block.js @@ -80,7 +80,7 @@ ParserBlock.prototype.tokenize = function (state, startLine, endLine) { if (ok) { break; } } - // set state.tight iff we had an empty line before current tag + // set state.tight if we had an empty line before current tag // i.e. latest empty line should not count state.tight = !hasEmptyLines; diff --git a/lib/rules_block/list.js b/lib/rules_block/list.js index d489d33..585f51d 100644 --- a/lib/rules_block/list.js +++ b/lib/rules_block/list.js @@ -5,7 +5,7 @@ var isSpace = require('../common/utils').isSpace; -// Search `[-+*][\n ]`, returns next pos arter marker on success +// Search `[-+*][\n ]`, returns next pos after marker on success // or -1 on fail. function skipBulletListMarker(state, startLine) { var marker, pos, max, ch; @@ -33,7 +33,7 @@ function skipBulletListMarker(state, startLine) { return pos; } -// Search `\d+[.)][\n ]`, returns next pos arter marker on success +// Search `\d+[.)][\n ]`, returns next pos after marker on success // or -1 on fail. function skipOrderedListMarker(state, startLine) { var ch, @@ -210,12 +210,10 @@ module.exports = function list(state, startLine, endLine, silent) { while (pos < max) { ch = state.src.charCodeAt(pos); - if (isSpace(ch)) { - if (ch === 0x09) { - offset += 4 - (offset + state.bsCount[nextLine]) % 4; - } else { - offset++; - } + if (ch === 0x09) { + offset += 4 - (offset + state.bsCount[nextLine]) % 4; + } else if (ch === 0x20) { + offset++; } else { break; } @@ -316,7 +314,7 @@ module.exports = function list(state, startLine, endLine, silent) { if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; } } - // Finilize list + // Finalize list if (isOrdered) { token = state.push('ordered_list_close', 'ol', -1); } else {