Fix #205: stop gutter drift from phantom newline rows #215

Merged
fen merged 1 commits from fix-205 into dev 2026-09-10 18:15:03 +00:00
Collaborator

Summary

  • paste-lines.js splitLines() now strips whitespace-only text nodes between .codeline blocks after rebuilding innerHTML — under white-space: pre any surviving whitespace-only node renders as a phantom row, drifting gutter numbers from their lines (issue #205).
  • renumber() geometry unchanged; wrap OFF behavior unchanged.
  • highlight.go comment documents that the server-side \n join is the splitLines delimiter by design; test comment updated.

QA (local serve, measured via CDP)

  • Python paste (long/blank/tab lines): wrap ON — max drift 0px @1400x900 and @375x812; no horizontal scroll. Wrap OFF — horizontal scroll preserved.
  • plain/text paste: same, max drift 0px both viewports.
  • Zero whitespace-only text nodes in rendered DOM; console clean, no CSP violations.
  • go build ./... && go test ./... pass.

Closes #205

## Summary - paste-lines.js splitLines() now strips whitespace-only text nodes between .codeline blocks after rebuilding innerHTML — under white-space: pre any surviving whitespace-only node renders as a phantom row, drifting gutter numbers from their lines (issue #205). - renumber() geometry unchanged; wrap OFF behavior unchanged. - highlight.go comment documents that the server-side \n join is the splitLines delimiter by design; test comment updated. ## QA (local serve, measured via CDP) - Python paste (long/blank/tab lines): wrap ON — max drift 0px @1400x900 and @375x812; no horizontal scroll. Wrap OFF — horizontal scroll preserved. - plain/text paste: same, max drift 0px both viewports. - Zero whitespace-only text nodes in rendered DOM; console clean, no CSP violations. - go build ./... && go test ./... pass. Closes #205
fen added 1 commit 2026-09-10 18:12:25 +00:00
Fix #205: strip whitespace-only text nodes between codeline blocks
CI / docker (pull_request) Skipped
CI / test (pull_request) Successful in 43s
5034f156ee
paste-lines.js rebuilt the codebody with innerHTML but relied on the
server-side '\n' delimiters disappearing between the per-line blocks.
Under white-space: pre any whitespace-only text node that survives
(cached HTML, template drift) renders as a phantom row and drifts the
gutter numbers off their lines. splitLines() now strips whitespace-only
text nodes after rebuilding, keeping renumber() geometry intact.
fen closed this pull request 2026-09-10 18:12:40 +00:00
fen deleted branch fix-205 2026-09-10 18:12:40 +00:00
fen reopened this pull request 2026-09-10 18:13:01 +00:00
fen closed this pull request 2026-09-10 18:13:36 +00:00
fen reopened this pull request 2026-09-10 18:14:55 +00:00
fen merged commit 13884ca786 into dev 2026-09-10 18:15:03 +00:00
Sign in to join this conversation.