Expand description
Minimal text-shape normalization: line-ending detection / round-trip and BOM stripping. The patcher uses these to canonicalize text to LF before applying edits and to restore the original shape on write-back.
Ported from omp packages/hashline/src/normalize.ts.
Structs§
- BomResult
- BOM strip result.
Enums§
- Line
Ending - Line ending style.
Functions§
- detect_
line_ ending - Detect the first line ending style in
content. Defaults to LF when neither is present. - normalize_
to_ lf - Normalize every line ending to LF.
- restore_
line_ endings - Re-encode LF text with the requested line ending.
- strip_
bom - Strip a UTF-8 BOM if present.