From 4fb203c1dbc7eff5ad8d06c7d3c78bb31f7be2a5 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 18 Aug 2023 17:20:45 -0400 Subject: [PATCH] Putting in new-line characters in the empty lines has fixed copy+paste and made the min-height css unnecessary. --- static/index.html | 2 +- static/script.js | 7 ++----- static/style.css | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/static/index.html b/static/index.html index 789df28..7c72ec6 100644 --- a/static/index.html +++ b/static/index.html @@ -8,6 +8,6 @@

Input org-mode source:


-
This is line 1This is line 2This is line 3
+
diff --git a/static/script.js b/static/script.js index 14f32f9..e8467fd 100644 --- a/static/script.js +++ b/static/script.js @@ -19,14 +19,11 @@ async function renderParseResponse(response) { const numLines = lines.length; const numDigits = Math.log10(numLines) + 1; - // outputElement.style.counterSet = "code_line_number 0;"; - outputElement.style.paddingLeft = `calc(${numDigits + 1}ch + 10px);`; + outputElement.style.paddingLeft = `calc(${numDigits + 1}ch + 10px)`; - // TODO: Do I need to set counter-set? - console.log(lines); for (let line of lines) { let wrappedLine = document.createElement("code"); - wrappedLine.textContent = line; + wrappedLine.textContent = line ? line : "\n"; outputElement.appendChild(wrappedLine); } } diff --git a/static/style.css b/static/style.css index 95d5644..db98321 100644 --- a/static/style.css +++ b/static/style.css @@ -35,7 +35,6 @@ h7 { .code_block > code { display: table; counter-increment: code_line_number; - min-height: 1.4em; } .code_block > code::before {