Open jcorbin opened 4 years ago
You might find https://github.com/jsternberg/markdownfmt to be relevant.
Is there an answer for this? I'm also keen to render a blackfriday.Node
back to markdown.
I imported github.com/jsternberg/markdownfmt/markdown and used it as here: https://github.com/Vaelatern/mdbook-d2-go/blob/ace29af66b63df6f54abc66973104b49bb0d6c4f/main.go#L186-L192 to go from blackfriday's AST back to markdown
also pictured, an example of mutating an AST before returning it to markdown.
Trying to write a program that's mostly an AST transformer, but I can't seem to find any way to turn a (v2) node back into markdown text ( short of writing my own markdown renderer that is, which I'd like to avoid? or at worst, contribute to the library, rather than maintain in my project? )