This Space for Rent

New (beta) Code!

Discount has, once again, another beta release with the publication of version 2.0.4beta2, which keeps the markdown-extra style definition list support, but corrects pair of edge cases dealing with enumerated lists and blockquoted paragraphs.

First of all, it turns out that paragraphs inside a list item and a blockquote will absorb adjacent code blocks, so code like

  * This is a list item
            with code, eh?

will generate

<ul>
<li>This is a list item
  with code, eh?</li>
</ul>

instead of the traditional discount behavior of splitting off with code, eh? and plopping it into a <code> block.

Siiiiiiiiiiiiigh.

Well, I want to maintain as close compatability to the standard™ as I can, so this means that I need to put in yet another horrible standards kludge to make nested text work differently from top-level text.

The other modification is possibly my misreading of the spec; When I was setting the indent for list items, I took the space indent, the width of the tag, then a space, even if that was > 4. This is not how it works according to the rest of the world, so I’ve had to add a boundary check to trim list item indent down to 4 spaces if it’s larger. This has the advantage that I can continue to ^D/^T (or tab if you’re one of those people who sets tabstops at 4 space headways) to line up indented code blocks correctly, and it doesn’t seem to break anything else (it actually fixed some old markdown that I’d written early on in the markdown era on tsfr.)

This is still beta code, so there is the traditional woeful lack of test cases and documentation, but why not live dangerously? After all, it’s only monday, so you’ve got all week to enjoy the spectacle of some nice New Code! while you’re waiting for that delayed meeting to finally start.