Skip to main content

remove_block_bytewise

Function remove_block_bytewise 

Source
pub fn remove_block_bytewise(content: &str, sentinel: &Sentinel<'_>) -> String
Expand description

Byte-offset block removal (shells::profile’s semantics).

No-op if either marker is missing. When present, consumes one preceding blank line (a literal "\n\n" tail immediately before the start marker) and the trailing LF or CRLF immediately after the end marker, if present.

On CRLF input the preceding blank line is not consumed because the check deliberately looks for a literal "\n\n" tail. CRLF bytes elsewhere in content are left untouched (this function never rewrites line endings).