The handwritten parser is good but any extensions on it are perhaps starting to get a bit difficult to understand; lots of conditionals and magic strings.
The parser could be made more legible (albeit more slow) by reimplementing with Sprache. A good alternative is N. Blumhardt's other parser Superpower, but note that I do already have a Markdown parser implemented in Sprache that would be a good starting point.
Two options open for discussion there: either the markdown parser could be modified to return CFWeaver AST models, and the erroneous parts of the parser removed. Alternately, a transformer could be written to build the CFWeaver AST from the generated Markdown AST, which would be more complicated but would have the advantage of being MD-parser-agnostic.
Leaning towards the former option (include custom parser) for the sake of being able to have more control over the parsing.
The handwritten parser is good but any extensions on it are perhaps starting to get a bit difficult to understand; lots of conditionals and magic strings.
The parser could be made more legible (albeit more slow) by reimplementing with Sprache. A good alternative is N. Blumhardt's other parser Superpower, but note that I do already have a Markdown parser implemented in Sprache that would be a good starting point.
Two options open for discussion there: either the markdown parser could be modified to return CFWeaver AST models, and the erroneous parts of the parser removed. Alternately, a transformer could be written to build the CFWeaver AST from the generated Markdown AST, which would be more complicated but would have the advantage of being MD-parser-agnostic.
Leaning towards the former option (include custom parser) for the sake of being able to have more control over the parsing.