From 8f4cc2d173f2b450715ce93bb9b0ffbb6bca4262 Mon Sep 17 00:00:00 2001 From: Maneren <49210777+Maneren@users.noreply.github.com> Date: Fri, 27 Oct 2023 21:22:00 +0200 Subject: [PATCH] fix(codejar-linenumbers): remove the extra line number at the bottom --- src/codejar-linenumbers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codejar-linenumbers.ts b/src/codejar-linenumbers.ts index 3fe24d2..0061036 100644 --- a/src/codejar-linenumbers.ts +++ b/src/codejar-linenumbers.ts @@ -32,7 +32,7 @@ export function withLineNumbers( } const code = editor.textContent || "" - const linesCount = code.replace(/\n\n$/g, "\n").split("\n").length + const linesCount = code.replace(/\n$/g, "").split("\n").length let text = "" for (let i = 0; i < linesCount; i++) {