summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng-Han, Wu2016-03-04 23:20:17 +0800
committerCheng-Han, Wu2016-03-04 23:20:17 +0800
commit109d9881d985eb2abf94849d55b3a39e5766c6f2 (patch)
tree79bff77ceb7d31c4ec7aa756f7b4e77060af2a5e
parentee5eddaff435ebc65b61967d9d1a5142f6109690 (diff)
Fixed list_item_open rules of markdown-it rules in syncscoll should now check level number
Diffstat (limited to '')
-rw-r--r--public/js/syncscroll.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/public/js/syncscroll.js b/public/js/syncscroll.js
index 85a62c32..7cf62bc5 100644
--- a/public/js/syncscroll.js
+++ b/public/js/syncscroll.js
@@ -25,7 +25,13 @@ md.renderer.rules.bullet_list_open = function (tokens, idx, options, env, self)
};
md.renderer.rules.list_item_open = function (tokens, idx, options, env, self) {
tokens[idx].attrJoin('class', 'raw');
- addPart(tokens, idx);
+ if (tokens[idx].map) {
+ var startline = tokens[idx].map[0] + 1;
+ var endline = tokens[idx].map[1];
+ tokens[idx].attrJoin('class', 'part');
+ tokens[idx].attrJoin('data-startline', startline);
+ tokens[idx].attrJoin('data-endline', endline);
+ }
return self.renderToken.apply(self, arguments);
};
md.renderer.rules.ordered_list_open = function (tokens, idx, options, env, self) {