diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/js/extra.js | 4 | ||||
-rw-r--r-- | public/js/syncscroll.js | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/public/js/extra.js b/public/js/extra.js index d5df6a6d..2a43268e 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -429,8 +429,8 @@ var md = new Remarkable('full', { typographer: true, highlight: highlightRender }); -md.renderer.rules.list_item_open = function (/* tokens, idx, options, env */) { - return '<li class="raw">'; +md.renderer.rules.list_item_open = function ( /* tokens, idx, options, env */ ) { + return '<li class="raw">'; }; md.renderer.rules.blockquote_open = function (tokens, idx /*, options, env */ ) { return '<blockquote class="raw">\n'; diff --git a/public/js/syncscroll.js b/public/js/syncscroll.js index 143e668e..01bc7d78 100644 --- a/public/js/syncscroll.js +++ b/public/js/syncscroll.js @@ -31,6 +31,15 @@ md.renderer.rules.bullet_list_open = function (tokens, idx /*, options, env */ ) return '<ul>\n'; }; +md.renderer.rules.list_item_open = function (tokens, idx /*, options, env */ ) { + if (tokens[idx].lines) { + var startline = tokens[idx].lines[0] + 1; + var endline = tokens[idx].lines[1]; + return '<li class="raw" data-startline="' + startline + '" data-endline="' + endline + '">\n'; + } + return '<li class="raw">'; +}; + md.renderer.rules.ordered_list_open = function (tokens, idx /*, options, env */ ) { var token = tokens[idx]; if (tokens[idx].lines && tokens[idx].level === 0) { |