<{name}> "#), ContentType::Html);
el.after("
", ContentType::Html);
el.remove_and_keep_content();
Ok(())
}),
element!("xeblog-hero", |el| {
let file = el.get_attribute("file").expect("wanted xeblog-hero to contain file");
el.replace(&crate::tmpl::xeblog_hero(file, el.get_attribute("prompt")).0, ContentType::Html);
Ok(())
})
],
..RewriteStrSettings::default()
}).unwrap();
Ok(html)
}
fn iter_nodes<'a, F>(node: &'a AstNode<'a>, f: &F) -> Result<()>
where
F: Fn(&'a AstNode<'a>) -> Result<()>,
{
f(node)?;
for c in node.children() {
iter_nodes(c, f)?;
}
Ok(())
}
fn without_first(string: &str) -> &str {
string
.char_indices()
.nth(1)
.and_then(|(i, _)| string.get(i..))
.unwrap_or("")
}
fn crop_letters(s: &mut String, pos: usize) {
match s.char_indices().nth(pos) {
Some((pos, _)) => {
s.drain(..pos);
}
None => {
s.clear();
}
}
}