Custom markdown parser that dispatches events