Skip to content

html: record only missing final newlines on source cells - #4

Open
jvoisin wants to merge 1 commit into
ctrliq:mainfrom
jvoisin:newl
Open

jvoisin wants to merge 1 commit into
ctrliq:mainfrom
jvoisin:newl

Conversation

@jvoisin

@jvoisin jvoisin commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Every source cell carried a data-newline attribute, yet nearly all lines end in a newline and the viewer never reads the value. Write the attribute only for a line without its final newline, which removes about 3% of a large report's size.

Every source cell carried a data-newline attribute, yet nearly all
lines end in a newline and the viewer never reads the value. Write
the attribute only for a line without its final newline, which removes
about 3% of a large report's size.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 11:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrow output change preserves missing-newline information without affecting viewer behavior or existing consumers.

0 open findings

What changed in this PR

Reduces generated HTML report size by recording newline metadata only when a source line lacks its final newline.

Changes:

  • Omits redundant data-newline="yes" attributes while preserving missing-newline markers.
  • Updates both sample reports to match the renderer output.
File Description
src/​html.c Emits newline metadata only for missing final newlines.
samples/​indentation.html Removes redundant affirmative newline attributes.
samples/​arguments.html Removes redundant affirmative newline attributes.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants