With this code is now possible to convert markdown to an AST data structure to inspect and manipulate using regular Elixir APIs based on Floki since we're using the exact same format as {node, attrs, children}.
Two examples are available to show how that works:
With this code is now possible to convert markdown to an AST data structure to inspect and manipulate using regular Elixir APIs based on Floki since we're using the exact same format as
{node, attrs, children}
.Two examples are available to show how that works:
Mermaid
https://github.com/leandrocp/mdex/blob/lp-encode-decode-ast/examples/mermaid.exs
Alerts
https://github.com/leandrocp/mdex/blob/lp-encode-decode-ast/examples/alerts.exs
Those functions are pretty low-level at the moment but we'll provide a more high-level API to manipulate the AST and also to attach plugins.