Merge pull request 'Fix #194 r2: line-number gutter alignment in both wrap modes' (#198) from fix-194-r2 into dev
CI / test (push) Successful in 47s
CI / docker (push) Successful in 49s

This commit was merged in pull request #198.
This commit is contained in:
fen
2026-09-10 17:11:08 +00:00
2 changed files with 11 additions and 2 deletions
+8 -2
View File
@@ -13,7 +13,13 @@
};
// Wrap each logical line (split on newline; spans never contain newlines
// because HighlightCode highlights per line) in a .codeline block.
// because HighlightCode highlights per line) in a .codeline block. The
// blocks must be adjacent with NO newline text between them (#194):
// .codeline is display:block, and under pre-wrap each interleaved '\n'
// text node renders as an extra phantom row in the code column that
// renumber() does not count, drifting the gutter off alignment on
// wrapped lines. Blank lines become empty blocks; .codeline:empty keeps
// them one row tall (see app.css).
function splitLines() {
var html = body.innerHTML;
var parts = html.split('\n');
@@ -21,7 +27,7 @@
for (var i = 0; i < parts.length; i++) {
out.push('<span class="codeline">' + parts[i] + '</span>');
}
body.innerHTML = out.join('\n');
body.innerHTML = out.join('');
}
function renumber() {