What's wrong
TrimBody (Frontmatter/Frontmatter.cs:502-519) only advances past leading blank lines on '\n'. SplitLines (Frontmatter.cs:465) documents support for CRLF, LF and CR, so CR-only documents parse fine but their leading blank body lines are never trimmed.
Repro (main @ 23c87b1)
Frontmatter.ExtractBody("---\rtitle: x\r---\r\r\rBody\r"); // "\r\rBody" (LF equivalent gives "Body")
Frontmatter.RemoveFrontmatter("---\rtitle: x\r---\r\r\rBody\r"); // "\r\rBody" + NewLine
Frontmatter.ReplaceFrontmatter(...) // writes "---\ntitle: y\n---\n\r\rBody"
Expected: "Body", the same as for LF and CRLF input.
Why it matters
The output depends on line-ending style, and callers get stray blank lines at the start of the body. Low impact since CR-only files are rare, but it contradicts the line-ending support SplitLines advertises.
Suggested fix
In TrimBody, treat both terminators as line ends: if (c is '\n' or '\r') start = i + 1;. For CRLF this still lands after the \n.
Acceptance: ExtractBody/RemoveFrontmatter return the same body for CR, LF and CRLF versions of a document with blank lines after the header.
What's wrong
TrimBody(Frontmatter/Frontmatter.cs:502-519) only advances past leading blank lines on'\n'.SplitLines(Frontmatter.cs:465) documents support for CRLF, LF and CR, so CR-only documents parse fine but their leading blank body lines are never trimmed.Repro (main @ 23c87b1)
Expected:
"Body", the same as for LF and CRLF input.Why it matters
The output depends on line-ending style, and callers get stray blank lines at the start of the body. Low impact since CR-only files are rare, but it contradicts the line-ending support
SplitLinesadvertises.Suggested fix
In
TrimBody, treat both terminators as line ends:if (c is '\n' or '\r') start = i + 1;. For CRLF this still lands after the\n.Acceptance:
ExtractBody/RemoveFrontmatterreturn the same body for CR, LF and CRLF versions of a document with blank lines after the header.