diff --git a/lib/rules_block/hr.js b/lib/rules_block/hr.js index 8638f04..8d9fb20 100644 --- a/lib/rules_block/hr.js +++ b/lib/rules_block/hr.js @@ -6,10 +6,11 @@ var isSpace = require('../common/utils').isSpace; module.exports = function hr(state, startLine, endLine, silent) { - var marker, cnt, ch, token, + var marker, cnt, ch, token, originalPos, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine]; + originalPos = pos; marker = state.src.charCodeAt(pos++); // Check hr marker @@ -37,6 +38,8 @@ module.exports = function hr(state, startLine, endLine, silent) { token = state.push('hr', 'hr', 0); token.map = [ startLine, state.line ]; token.markup = Array(cnt + 1).join(String.fromCharCode(marker)); + token.position = originalPos; + token.size = pos - originalPos; return true; };