Skip to content

Commit 4bf475f

Browse files
committed
fix: only blockquote need line offset
1 parent 5627ef8 commit 4bf475f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/common/utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,12 @@ var _g = typeof global !== 'undefined' ? global : window;
294294
var tokensRef = new _g.WeakMap();
295295

296296
function getLineOffset(state) {
297-
const blockState = state.env.state_block;
298-
return blockState.lineOffsets[state.currentLine] ?? 0;
297+
if (state.env.parentToken.parentType === 'blockquote') {
298+
const blockState = state.env.state_block;
299+
return blockState.lineOffsets[state.currentLine] ?? 0;
300+
} else {
301+
return 0;
302+
}
299303
}
300304

301305
function trimLeftOffset(str) {

0 commit comments

Comments
 (0)