Skip to content

Commit

Permalink
Fix positional info
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Oct 12, 2020
1 parent 1d367de commit 8d00209
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions from-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ function exitParagraphWithTaskListItem(token) {
) {
// Must start with a space or a tab.
head.value = head.value.slice(1)
head.position.start.column++
head.position.start.offset++
node.position.start = Object.assign({}, head.position.start)
}

this.exit(token)
Expand Down
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ test('markdown -> mdast', function (t) {
type: 'text',
value: 'a',
position: {
start: {line: 1, column: 6, offset: 5},
start: {line: 1, column: 7, offset: 6},
end: {line: 1, column: 8, offset: 7}
}
}
],
position: {
start: {line: 1, column: 3, offset: 2},
start: {line: 1, column: 7, offset: 6},
end: {line: 1, column: 8, offset: 7}
}
}
Expand Down

0 comments on commit 8d00209

Please sign in to comment.