This Space for Rent

New (experimental) Code!

Discount has not been officially pushed up to version 1.6.2, but is floating in a 1.6.2 prerelease state. I’ve reworked emphasis matching (again!) so that it won’t generate html that will make the baby Jesus cry, but before I fold the work back into the mainstream I want to send it out so that people can beat up on it for a while.

Aside from redoing emphasis so that pathological emphasis won’t (hopefully) generate misblocked <em> and <bold> blocks, I’ve also done a couple of quick fixes:

  1. A * out by itself in the middle of whitespace will no longer be treated as emphasis. Ditto for a _. (I don’t know why it was doing this; perhaps I misread the spec. I didn’t discover this until I built up a recent version of discount on one of my servers that was running an ancient version of the code – the configuration there wasn’t set up to build with all of the bells and whistles in the modern code, so when I pushed the archive over there and made it, the standard test cases failed on 1*2 + 3 * 4, which was emphasized by discount, but not by Markdown.pl.)
  2. I handle the standard markdown two-spaces-at-eol-is-<br/> case by substituting ^C<EOL> <space><space><EOL> in text blocks, then later converting all ^Cs into <br/>. But I wasn’t doing the second subsitution inside []() or backticked code, so ^C could make it into the output if a []() or code that extended across lines. 1.6.2 (and this experimental prerelease) unsubstitutes ^C back to a pair of spaces in those two places.

If you’re feeling brave, this is the New Code! you want to download, test, and play with. Hopefully it won’t eat your markdown text, and I can release a real 1.6.2 shortly.