Remove blank physical rows or limit each blank run to a chosen maximum.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
CRLF/LF input becomes rows, and trim determines whether a whitespace-only row is blank unless that check is disabled. A run counter either filters every blank or retains only the requested leading portion before joining rows with LF.
line one line two line three line four
line one line two line three line four
Address imports shed blank records, Markdown drafts keep one paragraph gap, and log excerpts become suitable for line comparison.