This PR reintroduces a feature which I had intentionally ripped out in the Rust write: the ability to parse text and manipulate the resulting node(s).
To accomplish this, I had to do some truly awkward " serializing " as I couldn't get magnus to play very nicely with comrak's use of typed_arena (and more specifically, lifetimes). I end up having to get the node data, unpack it, iterate over it, and then turn the raw comrak data into Commonmarker Ruby-ish data. It's kind of a beautiful mess.
I only implemented a few AST methods for now, as I only needed a few for the project I'm working on.
This PR reintroduces a feature which I had intentionally ripped out in the Rust write: the ability to
parse
text and manipulate the resulting node(s).To accomplish this, I had to do some truly awkward " serializing " as I couldn't get magnus to play very nicely with comrak's use of typed_arena (and more specifically, lifetimes). I end up having to get the node data, unpack it, iterate over it, and then turn the raw comrak data into Commonmarker Ruby-ish data. It's kind of a beautiful mess.
I only implemented a few AST methods for now, as I only needed a few for the project I'm working on.
xref https://github.com/gjtorikian/commonmarker/issues/199