Skip to main content

fence_for

Function fence_for 

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

The fence for a content: three backticks, or one more than its longest run of them, so that nothing the content holds can close the block that carries it.

use majordomus_cli::pack::fence_for;
assert_eq!(fence_for("plain"), "```");
assert_eq!(fence_for("a `` b"), "```");
assert_eq!(fence_for("````\ninside\n````"), "`````");