mirror of
https://github.com/YGGverse/ggemtext.git
synced 2026-03-31 17:15:33 +00:00
update comments, create new string on parsed only
This commit is contained in:
parent
12091be50a
commit
04120b2c44
3 changed files with 10 additions and 7 deletions
|
|
@ -18,10 +18,10 @@ impl Inline {
|
||||||
RegexMatchFlags::DEFAULT,
|
RegexMatchFlags::DEFAULT,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Detect value
|
// Extract formatted value
|
||||||
let value = regex.get(1)?;
|
let value = regex.get(1)?.trim();
|
||||||
|
|
||||||
if value.trim().is_empty() {
|
if value.is_empty() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,13 +37,16 @@ impl Header {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Detect header value
|
// Detect header value
|
||||||
let value = regex.get(2)?.to_string();
|
let value = regex.get(2)?.trim();
|
||||||
|
|
||||||
if value.trim().is_empty() {
|
if value.is_empty() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Result
|
// Result
|
||||||
Some(Self { level, value })
|
Some(Self {
|
||||||
|
level,
|
||||||
|
value: value.to_string(),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ impl Quote {
|
||||||
RegexMatchFlags::DEFAULT,
|
RegexMatchFlags::DEFAULT,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Detect value
|
// Extract formatted value
|
||||||
let value = regex.get(1)?.trim().to_string();
|
let value = regex.get(1)?.trim().to_string();
|
||||||
|
|
||||||
// Result
|
// Result
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue