Putting in new-line characters in the empty lines has fixed copy+paste and made the min-height css unnecessary.
This commit is contained in:
parent
51b4eed034
commit
4fb203c1db
@ -8,6 +8,6 @@
|
||||
<h2>Input org-mode source:</h2>
|
||||
<textarea id="org-input" rows="24" cols="80"></textarea>
|
||||
<hr/>
|
||||
<div id="parse-output" class="code_block" style="padding-left: calc(2ch + 10px); counter-set: code_line_number 0;"><code>This is line 1</code><code class="highlighted">This is line 2</code><code>This is line 3</code></div>
|
||||
<div id="parse-output" class="code_block" style="counter-set: code_line_number 0;"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ h7 {
|
||||
.code_block > code {
|
||||
display: table;
|
||||
counter-increment: code_line_number;
|
||||
min-height: 1.4em;
|
||||
}
|
||||
|
||||
.code_block > code::before {
|
||||
|
Loading…
Reference in New Issue
Block a user