pillar-markup / Microdown

Microdown is a cleaned and simpler markdown but with more powerful features such as extensions.
Other
39 stars 30 forks source link

Parser refactoring #462

Open kasperosterbye opened 2 years ago

kasperosterbye commented 2 years ago

Currently the AST nodes (blocks) implement part of the parsing algorithm. One way to refactoring this would be to split the blocks into two objects:

Besides being a cleaner design, it will allow us to:

This is a large rewrite, and it is not critical.

kasperosterbye commented 2 years ago

I just wanted it to sit here for us to remember the idea

kasperosterbye commented 2 years ago

The github way of allowing backquotes in inline codeblocks like this ` one is to mark the codeblock with two back quotes: mark with `` and end with `` (to embed two backquotes you mark the codeblock with three backquotes etc). Just an other example of the need to separate the parsing and the AST blocks.

kasperosterbye commented 2 years ago

This is something I would like to do in the fall. It will make things nicer, and also be a chance to revisit the inline parser. But in particular, it will make it clearer which states of the block should be internal to the parser, and which is intrinsic AST nodes.