Skip to content

For fun: use DFA to parse code from markdown block.

Hongtao Yang requested to merge better-md-parsing into main

This is a fun MR to get some hands-on experience on Deterministic Finite Automaton (DFA) and to use that to solve an actual problem we have: markdown block parsing. The opportunity of applying such a abstract object (DFA) on some real world problem is very rare, so when I saw the opportunity, I couldn't resist to try it out.

This MR introduce a alternative way of extracting code in a markdown block (enclosed by ```) using DFA. DFA is a very powerful tool, and it is almost an overkill for this problem.

If you like this approach, we can go ahead to polish and merge this MR. If not, we can simply leave this as a fun exploration and close the MR.

Edited by Hongtao Yang

Merge request reports