This Space for Rent

New Code!

Discount has been pushed up to version 1.5.2 with code changes to deal with two long-standing but obscure bugs. One bug is with how I implemented >%div% blocks (you could not have two consecutive >%div% blocks because the second one would be sucked up and treated as part of the first (with a bonus %div% in the output),) and the other dates back from the beginning of time when I misread the spec and thought that the link part of a footnote link only counted at the start of a block. This was not the case, and thus perfectly valid (if cosmetically horrid code) like

This is a paragraph
[footnote]: http://weblog.pell.portland.or.us/~orc/2009/08/12/000
that contains [this link][footnote].

Would not produce the proper (or expected?) output of:

This is a paragraph that contains this link.

But would instead produce something along the lines of

This is a paragraph [footnote]: http://weblog.pell.portland.or.us/~orc/2009/08/12/000 that contains [this link][footnote].

Well, I rewrote some of the parser to handle this, and now it works like the reference implementation. Note that there are still some differences between my implementation and the reference implementation; the reference will not treat [footnote]: as a footnote link if the body of the link contains any whitespace, while I will accept whitespace. I am still thinking about whether this is a defect I have to correct, or if it’s a feature (like not parsing _’s in the middle of a word) that I want to keep.

But it’s New Code! and it doesn’t appear to break annotations or any of my test scripts, so it’s ready to make your machine explode, catch fire, and sink to the middle of the earth!