MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / escape_char

Function escape_char

src/text_input.rs:1845–1850  ·  view source on GitHub ↗

Escape a character that would be interpreted as styling markup. Characters `{`, `}`, `|`, and `\` are prefixed with `\`.

(ch: char)

Source from the content-addressed store, hash-verified

1843 /// Escape a character that would be interpreted as styling markup.
1844 /// Characters `{`, `}`, `|`, and `\` are prefixed with `\`.
1845 pub fn escape_char(ch: char) -> String {
1846 match ch {
1847 '{' | '}' | '|' | '\\' => format!("\\{}", ch),
1848 _ => ch.to_string(),
1849 }
1850 }
1851
1852 /// Escape all styling-significant characters in a string.
1853 pub fn escape_str(s: &str) -> String {

Callers 1

insert_char_styledMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected