Skip to main content

strip_heredoc

Function strip_heredoc 

Source
pub fn strip_heredoc(input: &str) -> String
Expand description

Strip a whole-input heredoc wrapper; mirrors patch-parser.ts:33-36.

The TypeScript regex uses a backreference for the closing delimiter. Rust’s regex crate intentionally omits backreferences, so this uses regex for the opening heredoc syntax and then verifies the matching closing delimiter manually to preserve the same anchored wrapper behavior.