orgize icon indicating copy to clipboard operation
orgize copied to clipboard

accessing ExportBlock content

Open rrix opened this issue 9 months ago • 1 comments

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();
            }

rrix avatar May 08 '24 19:05 rrix

just implemented in commit 0b70cf04157ba57d26fbff6c096899ecef7e1e80, but not released yet.

PoiScript avatar May 09 '24 05:05 PoiScript

Yay :)

rrix avatar May 20 '24 18:05 rrix