diff --git a/lib/rules_block/paragraph.js b/lib/rules_block/paragraph.js index 18a860d..4ab7e61 100644 --- a/lib/rules_block/paragraph.js +++ b/lib/rules_block/paragraph.js @@ -7,7 +7,8 @@ module.exports = function paragraph(state, startLine/*, endLine*/) { var content, terminate, i, l, token, nextLine = startLine + 1, terminatorRules = state.md.block.ruler.getRules('paragraph'), - endLine = state.lineMax; + endLine = state.lineMax, + pos = state.bMarks[startLine]; // jump line-by-line until empty one or EOF for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { @@ -35,13 +36,19 @@ module.exports = function paragraph(state, startLine/*, endLine*/) { token = state.push('paragraph_open', 'p', 1); token.map = [ startLine, state.line ]; + token.position = pos; + token.size = 0; token = state.push('inline', '', 0); token.content = content; token.map = [ startLine, state.line ]; token.children = []; + token.position = pos; + token.size = content.length; token = state.push('paragraph_close', 'p', -1); + token.size = 0; + token.position = content.length + pos; return true; };