Skip to main content

strip_wrapping_fence

Function strip_wrapping_fence 

Source
fn strip_wrapping_fence(s: &str) -> Option<String>
Expand description

Strip a wrapping code fence (triple-backtick, optionally with a language tag on the opening line, or a single inline backtick) if the entire string is wrapped — a fence-like substring embedded mid-sentence is left alone. Returns the un-fenced inner text, trimmed.