Skip to main content

diff_fence

Function diff_fence 

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

Builds a Markdown code-fence delimiter long enough to safely wrap an arbitrary prompt payload.

Returns a string of backticks whose length exceeds the longest run of consecutive backticks found anywhere in content, with a minimum length of three. This prevents a triple-backtick fence from being terminated prematurely when the payload itself contains Markdown fences (for example, when reviewing changes to Markdown or prompt-template files).