[kramdown-users] 0.11 bug (feature?) with <pre>-in-<dd> parsing

Matt Neuburg matt at tidbits.com
Mon Nov 1 11:34:15 EDT 2010

On Nov 1, 2010, at 6:39 AM, Piotr Szotkowski wrote:

> I found out that the following Markdown
> is parsed differently by 0.10 and 0.12:
> foo
> : <pre class='bar'>baz { |qux| quux }</pre>
> After some testing it seems it was introduced in
> 5354385d6bec8c89e4d8c2c2b76f6d07433800c7

Right - this is a variety of the same behavior I complained about in 0.11. This is apparently the result of treating internal pipes as block-level indicators and processing them before processing span-level indicators (such as <pre>). I would code your example like this:

    baz { |qux| quux }
    {: .bar}

By using explicit "pre" indicators (~~~~) and an ALD, we end up with the same HTML you're after (except that we generate <pre><code> instead of pure <pre>). Notice that there is a space after the line-initial colon, otherwise the example doesn't work.

Ideally, I suppose, the same fix in 0.12 that ignores pipes in <code> tags should also be ignoring pipes in <pre> tags. m.

matt neuburg, phd = matt at tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
Take Control of Exploring & Customizing Snow Leopard
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com

More information about the kramdown-users mailing list