From: Waylan L. <wa...@gm...> - 2008-10-13 23:22:25
|
On Mon, Oct 13, 2008 at 1:40 PM, Yuri Takhteyev <qar...@gm...> wrote: [snip] > >> md.parser._MarkdownParser__processCodeBlock = __hiliteCodeBlock > > I think there is an entirely different (and better) way to do this > now. Use the standard MarkdownParser, then write a postprocessor to > modify the eTree. Don't know why I didn't think of this before. eTree makes is easy. I just pushed a refactored CodeHilite extension. Much cleaner. > At the moment, it appears that we don't offer an > option of modifying the tree before the patterns are run, but we > should. I.e., our pipeline should be: > > 1. text pre-processors (text-in, text-out) - tempated to drop this > 2. line pre-processors (line list in, line list out) > 3. MarkdownParser.parseDocument() - substitute your own if you want > 4. pre-pattern post-processors (modify the tree before any patterns are run) > 5. InlineProcessor.applyInlinePatterns() > 6. etree postprocessors (modify eTree) > 7. serialization of the etree into a string > 8. text postprocessors (text-in, text-out) Why not just make the InlineProcessor be one of the 'postprocessors' and then extensions can add additional postprocessors either before or after it as needed? -- ---- Waylan Limberg wa...@gm... |