Skip to content

Commit e5d4232

Browse files
committed
fix: emphasis and strikethrough position do not need add line offset
1 parent 4881ab4 commit e5d4232

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/rules_inline/emphasis.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
//
33
'use strict';
44

5-
var getLineOffset = require('../common/utils').getLineOffset;
6-
7-
85
// Insert each marker as a separate text token, and add it to delimiter list
96
//
107
module.exports.tokenize = function emphasis(state, silent) {
@@ -107,7 +104,7 @@ function postProcess(state, delimiters) {
107104
token.nesting = 1;
108105
token.markup = isStrong ? ch + ch : ch;
109106
token.content = '';
110-
token.position = startDelim.position + getLineOffset(state, startDelim.token);
107+
token.position = startDelim.position;
111108

112109
token = state.tokens[endDelim.token];
113110
token.type = isStrong ? 'strong_close' : 'em_close';

lib/rules_inline/strikethrough.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
//
33
'use strict';
44

5-
var getLineOffset = require('../common/utils').getLineOffset;
6-
75
// Insert each marker as a separate text token, and add it to delimiter list
86
//
97
module.exports.tokenize = function strikethrough(state, silent) {
@@ -76,7 +74,7 @@ function postProcess(state, delimiters) {
7674
token.nesting = 1;
7775
token.markup = '~~';
7876
token.content = '';
79-
token.position = startDelim.position + getLineOffset(state, startDelim.token);
77+
token.position = startDelim.position;
8078

8179
token = state.tokens[endDelim.token];
8280
token.type = 's_close';

0 commit comments

Comments
 (0)