Skip to content

Commit 109d988

Browse files
committed
Fixed list_item_open rules of markdown-it rules in syncscoll should now check level number
1 parent ee5edda commit 109d988

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

public/js/syncscroll.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ md.renderer.rules.bullet_list_open = function (tokens, idx, options, env, self)
2525
};
2626
md.renderer.rules.list_item_open = function (tokens, idx, options, env, self) {
2727
tokens[idx].attrJoin('class', 'raw');
28-
addPart(tokens, idx);
28+
if (tokens[idx].map) {
29+
var startline = tokens[idx].map[0] + 1;
30+
var endline = tokens[idx].map[1];
31+
tokens[idx].attrJoin('class', 'part');
32+
tokens[idx].attrJoin('data-startline', startline);
33+
tokens[idx].attrJoin('data-endline', endline);
34+
}
2935
return self.renderToken.apply(self, arguments);
3036
};
3137
md.renderer.rules.ordered_list_open = function (tokens, idx, options, env, self) {

0 commit comments

Comments
 (0)