You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(md072): keep every trailing newline when sorting frontmatter keys
The fix rebuilds the document through `lines()` + `join("\n")`, which drops
the empty element each trailing newline produces. Restoring a single newline
covered a file ending in exactly one, but a file ending in blank lines came
back one short, so sorting the keys silently deleted a blank line at the end
of the file. Restore the original count instead.
The test brackets 0 to 3 trailing newlines across YAML, TOML, JSON and a
whole-file frontmatter, and asserts the keys were actually sorted: a fix that
declined to run also leaves the newlines alone.
0 commit comments