From: Steven L S. <ssm...@zi...> - 2011-06-16 16:38:17
|
Thanks for the answer, Waylan. I guess I misunderstood the order of how things get processed. I ended up replacing my syntax with ~naz:showhide and ~/naz:showhide, and moving the order of my extension like you suggested, and it worked. ==================================== Steven L Smith, Web Developer Department of Information Technology Services Nazareth College of Rochester 585-389-2085 | ssm...@na... | KC2YTC http://www.naz.edu/pub/~ssmith46 ==================================== ----- Original Message ----- From: "Waylan Limberg" <wa...@gm...> To: "Steven L Smith" <ssm...@na...> Sent: Thursday, June 16, 2011 11:19:16 AM GMT -05:00 US/Canada Eastern Subject: Re: [Python-markdown-discuss] HTML Comments getting munged somehow On Thu, Jun 16, 2011 at 10:34 AM, Steven L Smith <ssm...@zi...> wrote: [snip] > My preprocessor basically says 'if the line is <!-- naz:showhide -->, replace it with <div class="showhide">'. > > In 2.0.3, I could do this with basic string operations, but in the trunk, the comments are stored in the "lines" list as some sort of weird string, and they're no longer matching. For example, "<!-- naz:showhide -->" is "\x02wzxhzdk:0\x03" by the time it gets to my extension. > That is the placeholder string for the raw html. It will be swapped out for the raw html later. Make sure your extension runs before the raw html preprocessor and you should be good (not sure why this would have changed since 2.0.3 either). Although, If I am understanding what your extension does, that means the markdown text will be wrapped in a div and won't get processed (per expected markdown behavior). Perhaps you should run a postprocessor after the "raw_html" postprocessor has swapped the placeholders back out for the raw html. -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg |