orgize
orgize copied to clipboard
accessing ExportBlock content
it would be nice if impl ExportBlock
had a value()
like SourceBlock
, and if that was included in the html exporter:
Event::Enter(Container::ExportBlock(the_block)) => {
let val = the_block
.syntax()
.children()
.find(|e| e.kind() == orgize::SyntaxKind::BLOCK_CONTENT)
.into_iter()
.flat_map(|n| n.children_with_tokens())
.filter_map(orgize::ast::filter_token(orgize::SyntaxKind::TEXT))
.fold(String::new(), |acc, value| acc + &value);
html_export.push_str(format!(r#"{}"#, val));
ctx.skip();
}
just implemented in commit 0b70cf04157ba57d26fbff6c096899ecef7e1e80, but not released yet.
Yay :)