Fix escapes in monospace and progressbar
Signed-off-by: trivernis <trivernis@protonmail.com>pull/15/head
parent
d60e6aabd4
commit
8cf6dd33b7
@ -1,6 +1,15 @@
|
|||||||
|
use regex::Regex;
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! parse {
|
macro_rules! parse {
|
||||||
($str:expr) => {
|
($str:expr) => {
|
||||||
Parser::new($str.to_string(), None).parse()
|
Parser::new($str.to_string(), None).parse()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Removes a single backslash from the given content
|
||||||
|
pub(crate) fn remove_single_backlslash<S: ToString>(content: S) -> String {
|
||||||
|
let content = content.to_string();
|
||||||
|
lazy_static::lazy_static! {static ref R: Regex = Regex::new(r"\\(?P<c>[^\\])").unwrap();}
|
||||||
|
|
||||||
|
R.replace_all(&*content, "$c").to_string()
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue