Organisationsocaml-ppxocamlformatbranch/fix-windows-crlf-codeblockBuild History

Build History for branch/fix-windows-crlf-codeblock

Builds (3)
odoc-parser: consume CRLF in handle_last_newline handle_last_newline scans backward and matches '\n' immediately, leaving the preceding '\r' (if any) on the stripped string. Because deindent then splits on '\n' and rejoins with '\n', every '\r' on an intermediate line ends up followed by a '\n' — but the '\r' on the last line is bare, since String.concat puts no separator after the final element. The OCaml lexer's newline regex is '\r*\n', so a bare trailing '\r' falls through to the Illegal_character rule. This caused the Windows CI to fail on any {@ocaml[...]} block in a CRLF-checked-out file. Mirror handle_first_newline (which already eats a leading '\r' before matching '\n'): when handle_last_newline finds '\n', also drop a preceding '\r' so the full CRLF is consumed.
77b7b2
odoc-parser: strip stray CR from deindented code block lines Splitting a code block on '\n' leaves a trailing '\r' on every line of CRLF input. count_leading_whitespace already discounts that '\r' when computing the indent, but drop didn't strip it from the line it returned, so the joined result still contained CRs. This made fmt_code on Windows fail with Lexer.Error (Illegal_character '\r') for any {@ocaml[...]} block, since the OCaml lexer's newline regex is '\r*\n' and rejects a bare CR. Strip the trailing '\r' in drop so the output uses LF only, matching what the rest of the pipeline expects.
3c7630
odoc-parser: strip stray CR from deindented code block lines Splitting a code block on '\n' leaves a trailing '\r' on every line of CRLF input. count_leading_whitespace already discounts that '\r' when computing the indent, but drop didn't strip it from the line it returned, so the joined result still contained CRs. This made fmt_code on Windows fail with Lexer.Error (Illegal_character '\r') for any {@ocaml[...]} block, since the OCaml lexer's newline regex is '\r*\n' and rejects a bare CR. Strip the trailing '\r' in drop so the output uses LF only, matching what the rest of the pipeline expects.
8af14e