diff --git a/lib/rules_block/code.js b/lib/rules_block/code.js index 470cb01..ed2e304 100644 --- a/lib/rules_block/code.js +++ b/lib/rules_block/code.js @@ -4,7 +4,9 @@ module.exports = function code(state, startLine, endLine/*, silent*/) { - var nextLine, last, token, emptyLines = 0; + var nextLine, last, token, emptyLines = 0, + pos = state.bMarks[startLine], + endPos; if (state.sCount[startLine] - state.blkIndent < 4) { return false; } @@ -34,11 +36,15 @@ module.exports = function code(state, startLine, endLine/*, silent*/) { break; } + endPos = state.bMarks[last] + state.tShift[last]; + state.line = last; token = state.push('code_block', 'code', 0); token.content = state.getLines(startLine, last, 4 + state.blkIndent, true); token.map = [ startLine, state.line ]; + token.position = pos; + token.size = endPos - pos; return true; };