Skip to content

Blank lines at @block/@end boundaries are consumed (blank runs collapse to 1) #151

Description

@dean0x

mds version: 0.3.0

Summary

A blank line between a block boundary (@end) and following text is removed in the output. More generally, one newline is eaten at the block/text boundary and a run of blank lines collapses to a single blank line.

Repro

boundary.mds:

@block a:
first
@end

second
$ mds build boundary.mds -o -

Actual:

first
second

Expected: (blank line preserved)

first

second

Additionally: with 2 blank lines between @end and the following text, the output has 1; with 3, still 1 (runs collapse to a single blank line).

Impact

Byte-exact output requires padding the template with extra blank lines around every block to compensate, and intentional double blank lines in content are collapsed. This is the main source of whitespace friction when reproducing existing files. Together with the frontmatter-blank issue, fixing this makes byte-identical dedup demos clean instead of hand-tuned.

Suggested direction

Treat text nodes adjacent to @block/@end verbatim, or if some normalization is intended, document it precisely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglanguageMDS language features and syntax

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions