From: Waylan L. <wa...@gm...> - 2013-05-02 00:55:56
|
Jake, As explained in the API docs [1], every processor is set to run in a certain order. If you insert your preprocessor before all others, then it is being run first. Without seeing your code, it is hard to know for sure, but my guess it that perhaps your preprocessor is inserting the code block as raw html (in <pre><code> tags). If so, then your code blocks are being treated as raw html and stored in the htmlStash until they are swapped back in by a postprocessor. In other words, they never see treeprocessors and therefore never get exposed to codehilite. Instead, you preprocessor should be inserting the code block using markdown formatting (indented at least four spaces). Then markdown will process the code block as usual. I hope that helps. Waylan [1]: http://pythonhosted.org/Markdown/extensions/api.html#integrating_into_markdown On Tue, Apr 30, 2013 at 10:21 AM, Jake Vanderplas <ja...@gm...> wrote: > Hello, > I'm trying to write an extension that will allow literal includes of files > in markdown, and do syntax highlighting if they contain code. > > I managed to get a preprocessor working which takes a suitably-annotated > filename, and replaces it with markdown which should then be interpreted by > the codehilite extension. I was surprised, though, when I found that the > output of my preprocessor is never processed by codehilite. It seems that > codehilite is modifying the text *before* my preprocessor modifies it: is > this the case? Is there any way to make sure a new extension preprocesses > the document before sending the result to another extension? > > Thanks for any help, > Jake > > ------------------------------------------------------------------------------ > Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET > Get 100% visibility into your production application - at no cost. > Code-level diagnostics for performance bottlenecks with <2% overhead > Download for free and get started troubleshooting in minutes. > http://p.sf.net/sfu/appdyn_d2d_ap1 > _______________________________________________ > Python-markdown-discuss mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss > -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg |