Update code tag

This commit is contained in:
Kenox 2022-11-03 20:58:54 +01:00
commit ff1ca863fa
4 changed files with 20 additions and 12 deletions

View file

@ -171,7 +171,7 @@ haste.prototype.lookupTypeByExtension = function(ext) {
// For the specified number of lines // For the specified number of lines
haste.prototype.addLineNumbers = function(lineCount) { haste.prototype.addLineNumbers = function(lineCount) {
removeElementsByClass('linenumber'); removeElementsByClass('linenumber');
for (var i = 0; i < lineCount; i++) { /*for (var i = 0; i < lineCount; i++) {
let div = document.createElement('a'); let div = document.createElement('a');
div.classList.add('linenumber'); div.classList.add('linenumber');
div.style.marginTop = i * 16 + 'px'; div.style.marginTop = i * 16 + 'px';
@ -194,7 +194,7 @@ haste.prototype.addLineNumbers = function(lineCount) {
behavior: 'smooth', behavior: 'smooth',
block: 'center' block: 'center'
});*/ });*/
} //}
}; };
function highlightLine(line) { function highlightLine(line) {

File diff suppressed because one or more lines are too long

View file

@ -76,7 +76,7 @@
</div> </div>
</div> </div>
<pre id="box" style="display:none;" class="hljs" tabindex="0"></pre> <pre id="box" style="display:none;" class="code" tabindex="0"></pre>
<textarea spellcheck="false" style="display:none;"></textarea> <textarea spellcheck="false" style="display:none;"></textarea>
</body> </body>

View file

@ -12,22 +12,30 @@ Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmai
color: #78797A; color: #78797A;
}*/ }*/
pre.hljs { pre.code {
white-space: pre-wrap; white-space: pre-wrap;
margin-left: 8em;
} }
pre.hljs::before {
pre.code::before {
counter-reset: listing; counter-reset: listing;
} }
pre.hljs code {
pre.code code {
counter-increment: listing; counter-increment: listing;
text-align: left;
float: left;
clear: left;
} }
pre.hljs code::before {
pre.code code::before {
content: counter(listing) ". "; content: counter(listing) ". ";
display: inline-block; display: inline-block;
width: 8em; /* now works */ float: left;
padding-left: auto; /* now works */ height: 3em;
margin-left: auto; /* now works */ padding-left: auto;
text-align: right; /* now works */ margin-left: auto;
text-align: right;
} }
.hljs-comment, .hljs-comment,