rewrite
i started a rewrite! what i was doing earlier was honestly too messy to actually use.
my earlier way was making a bunch of regexes and using those to match the remaining text. my new method is still using regexes, but i split the whole thing into two parts: block parser and inline parser.
block parser
- the block parser splits the markdown doc on newlines and checks what it starts with or ends with.
- when it finds that some line is not a paragraph, it pushes a token to the tokens array indicating that it is the start of a block. when it detects that the block has ended, it pushes a token to the tokens array indicating the end of the block.
- this is currently only implemented for headings, more are coming. it took this long because me dumb
inline parser
- the inline parser loops through the existing tokens array made by the block parser and looks for characters that indicate the start of an inline token like bold, italic and so on.
- like the block parser, it will push start and end tokens to the tokens array
- the implementation of the inline parser has not started yet
new character
i added a backslash to the giant block letters i made for headings!
Changelog
(bac8c5a) Start parser rewrite
(664713e) Add backslash in heading
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.