From 7279c448daded58376b7424db83619fc6213bdcf Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Thu, 10 Aug 2023 00:29:51 +0100 Subject: [PATCH] fix: don't display line numbers for one-line blocks --- src/ts/app.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ts/app.ts b/src/ts/app.ts index 1049c19..059bf0d 100644 --- a/src/ts/app.ts +++ b/src/ts/app.ts @@ -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"); }