fix sources location

This commit is contained in:
yggverse 2024-10-18 19:19:39 +03:00
parent 7df3bfeb91
commit d42af120ca
11 changed files with 1 additions and 1 deletions

29
src/line/quote.rs Normal file
View file

@ -0,0 +1,29 @@
use gtk::glib::{GString, Regex, RegexCompileFlags, RegexMatchFlags};
pub struct Quote {
pub value: GString,
}
impl Quote {
pub fn from(line: &str) -> Option<Self> {
// Parse line
let regex = Regex::split_simple(
r"^>\s*(.+)$",
line,
RegexCompileFlags::DEFAULT,
RegexMatchFlags::DEFAULT,
);
// Detect value
let value = regex.get(1)?;
if value.trim().is_empty() {
return None;
}
// Result
Some(Self {
value: GString::from(value.as_str()),
})
}
}