Differences From Artifact [eb1273e849]:
- File src/utils.rs — part of check-in [0f47e23e21] at 2026-01-12 10:15:24 on branch trunk — switch from MarkDown to Html, validate text as HTML before sending, count header size differently, also bump license while here (user: arcade, size: 799) [annotate] [blame] [check-ins using]
To Artifact [448dd04db5]:
- File src/utils.rs — part of check-in [c996f5c871] at 2026-01-12 13:41:17 on branch trunk — minor typos, add back tests, change formatting a lot (user: arcade, size: 788) [annotate] [blame] [check-ins using]
| ︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 30 | - - + |
}
/// Pass any text here to be validated as HTML, breaks on validation errors
pub fn validate (text: &str) -> Result<&str> {
let fragment = Html::parse_fragment(text);
if !fragment.errors.is_empty() {
bail!(fragment.errors.join("\n"));
|