diff options
author | Wu Cheng-Han | 2015-09-25 19:06:27 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2015-09-25 19:06:27 +0800 |
commit | 60414febee5fd14743fd80cad9d681c3027272dd (patch) | |
tree | 6342747e84e3b5a9063c30b717f16baa49d974ed /public/js | |
parent | 4e0a1021011e9c64c6d5c2fe82f17bc34ff529f8 (diff) |
Changed code block line number gutter rendering method for performance and gain better accessibility
Diffstat (limited to '')
-rw-r--r-- | public/js/extra.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/public/js/extra.js b/public/js/extra.js index cb6676bc..fd150bea 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -413,9 +413,9 @@ function highlightRender(code, lang) { var lines = result.value.split('\n'); var linenumbers = []; for (var i = 0; i < lines.length - 1; i++) { - linenumbers[i] = "<div class='linenumber'>" + (i + 1) + "</div>"; + linenumbers[i] = "<span data-linenumber='" + (i + 1) + "'></span>"; } - var linegutter = "<div class='gutter'>" + linenumbers.join('\n') + "</div>"; + var linegutter = "<div class='gutter linenumber'>" + linenumbers.join('\n') + "</div>"; result.value = "<div class='wrapper'>" + linegutter + "<div class='code'>" + result.value + "</div></div>"; } return result.value; |