fix: don't display line numbers for one-line blocks

This commit is contained in:
Oliver Booth 2023-08-10 00:29:51 +01:00
parent fa51e0a189
commit 7279c448da
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61
1 changed files with 2 additions and 2 deletions

View File

@ -1,10 +1,10 @@
declare const bootstrap: any;
declare const bootstrap: any;
declare const katex: any;
(() => {
document.querySelectorAll("pre code").forEach((block) => {
let content = block.textContent;
if (content.split("\n").length > 1) {
if (content.trim().split("\n").length > 1) {
block.parentElement.classList.add("line-numbers");
}