Skip to main content

remove_git_paw_section

Function remove_git_paw_section 

Source
pub fn remove_git_paw_section(content: &str) -> String
Expand description

Removes the git-paw managed block (start marker through end marker, inclusive — plus any blank lines immediately adjacent) from content.

If content has no start marker, returns content unchanged. This makes the helper safe to call unconditionally during teardown.

Adjacency rule: the helper consumes ONE leading blank line and ONE trailing blank line that surround the block, restoring the file to its pre-injection shape (inject_into_content inserts a leading blank line when appending to a non-empty file).