This Space for Rent

New Code!

Discount has been rolled up to version 1.3.6 with a slight tweak to the way I handle raw html blocks. When I first wrote the code, I didn’t spend much effort thinking about how to handle them and just hacked out a quick and dirty pattern matcher that passed the official test suite, but which would fall over and not find the end of the block on html sections like

<div><pre>
Gosh, I'm in a div block!
</pre></div>

I knew in the back of my head that my q&d parser wasn’t perfect, but as long as the only things that tripped up on it were my synthetic test cases there wasn’t anything that made it urgent (the text I work with is all pretty much pure markdown, with some html inserts (hit counters, videos, the occasional bikely map) that weren’t oddly formed enough to utterly confuse discount.

But then people started to use discount, and in the past couple of months I’ve gotten two bug reports of people being tripped up by the q&d parser. So I sat (for the “ride my bicycle out to Sandy” definition of “sat”) around and thought about a solution, prototyped it, tested it, and finally shoved it into version control and published it today.

It doesn’t change memory allocation at all, it doesn’t do any new code manipulation (except for scanning,) and the only data structures it adds are read-only. So it should be a defect-free upgrade. But it is New Code!, and my usage of it (this weblog & my website) may not be the same as the ruby, lua, and other users that have grabbed copies of discount and are now shoving them into websites and weblog software in places I don’t even know about. So if it causes mutations, please let me know so I can demutate my code.