Skip to content

Commit 8d00209

Browse files
committed
Fix positional info
1 parent 1d367de commit 8d00209

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

from-markdown.js

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ function exitParagraphWithTaskListItem(token) {
2323
) {
2424
// Must start with a space or a tab.
2525
head.value = head.value.slice(1)
26+
head.position.start.column++
27+
head.position.start.offset++
28+
node.position.start = Object.assign({}, head.position.start)
2629
}
2730

2831
this.exit(token)

test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ test('markdown -> mdast', function (t) {
3232
type: 'text',
3333
value: 'a',
3434
position: {
35-
start: {line: 1, column: 6, offset: 5},
35+
start: {line: 1, column: 7, offset: 6},
3636
end: {line: 1, column: 8, offset: 7}
3737
}
3838
}
3939
],
4040
position: {
41-
start: {line: 1, column: 3, offset: 2},
41+
start: {line: 1, column: 7, offset: 6},
4242
end: {line: 1, column: 8, offset: 7}
4343
}
4444
}

0 commit comments

Comments
 (0)