From 9467be97179faae97ea1810062c0119258eeaee5 Mon Sep 17 00:00:00 2001 From: andreimarcu Date: Fri, 17 Jun 2016 21:22:24 -0700 Subject: [PATCH] No margin/border without line numbers --- static/css/highlight/lines.css | 6 +++--- static/js/bin_hljs.js | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/static/css/highlight/lines.css b/static/css/highlight/lines.css index 68c7a56..107e272 100644 --- a/static/css/highlight/lines.css +++ b/static/css/highlight/lines.css @@ -1,14 +1,14 @@ -#normal-code { +.linenumbers { border-left: 1px solid #ccc; margin-left: 36px; position: relative; } -#normal-code code { +.linenumbers code { counter-reset: linenumbers; } -#normal-code code div:before { +.linenumbers code div:before { content: counter(linenumbers); counter-increment: linenumbers; left: -36px; diff --git a/static/js/bin_hljs.js b/static/js/bin_hljs.js index 083ef4c..bf11657 100644 --- a/static/js/bin_hljs.js +++ b/static/js/bin_hljs.js @@ -12,4 +12,7 @@ for (var i = 0; i < lines.length; i++) { codeb.appendChild(div); }; + +var ncode = document.getElementById("normal-code"); +ncode.className = "linenumbers"; // @license-end