From: Kjell M. F. <kj...@gm...> - 2008-08-26 17:23:52
|
On Tue, Aug 26, 2008 at 1:05 PM, Waylan Limberg <wa...@gm...> wrote: > On Tue, Aug 26, 2008 at 11:40 AM, Kjell Magne Fauske <kj...@gm...> wrote: >> On Tue, Aug 26, 2008 at 9:58 AM, Waylan Limberg <wa...@gm...> wrote: >>> Thanks Kjell. I suspected it was something like that. I just haven't >>> had the time to work on it. I was thinking perhaps I would have the >>> highlighter return the highlighted source without a div wrapping it, >>> then we could place that within a ET generated div. IIRC, there is a >>> way to get pygments to do that, but I couldn't tell you off the top of >>> my head what it is. If you want to give that a shot - feel free. >>> Otherwise I'll get to it when I have the time. >>> >> >> I now think I have found a fix. You can find the code attached. I am >> not familiar with Git, so I'm not sure if the patch is correctly >> formatted. >> > > Thanks Kjell, your patch was fine - and in the simple case it works. > However, when pygments adds line numbers to the source, the source > (and containing div) are wrapped in a table. However, with your patch > the table is wrapped in the div instead. I realize the div is only > there for styling hooks, but if css authors are expecting the div to > be a child of the table, that might break their css - so we need to be > consistent. After all, the idea is that people can use any of the > publicly available styles for pygments without any modification to > work with markdown. > > So I came up with another solution over lunch - which occurred to me > after I sent you my last message. See the comment and diff here: > http://gitorious.org/projects/python-markdown/repos/mainline/commits/a4c80246770b87ca3d2cce5b5184901fd2495a7d > > -- > ---- > Waylan Limberg > wa...@gm... > Great! Your solution was much cleaner than mine. No hard feelings :) Regarding breaking css, I have filed a new ticket #16 and asked for the addition of an option for setting the name of the wrapper css class: http://www.freewisdom.org/projects/python-markdown/Tickets/000016 Patch is attached, but I have probably overlooked something. Regards, Kjell Magne Fauske |