New Code! (super-experimental version)
Discount has been rolled up to version [1.4.1pre0]1.4.2 with a whole bunch of bugfixes that were reported by several people (and a single new feature.) It’s a pre
release instead of a full release because I’m still looking at some of the code I put in and trying to decide whether it’s the code I really want.
The 1.4.1pre0 version was pulled pretty quickly after I released it (but I didn’t actually get around to properly publishing it, due to a small misfeature in the
ipfw
kernel module in freebsd 4.4. It took until today before I made it into my colo to unload the ipfw module and make the machine talk to the world again) because I introduced a bug intolinkylinky()
which made the code dump core if I ever ran it with a base url specified.
But, be that as it might be, the bugfixes and new feature are:
- Three bugs reported by Mike Schiraldi:
- If -fautolink was turned on, a naked @ became a mailto:
link. Fixed by only triggering
maybe_tag_or_link()
on alphabetic characters. - If -fnohtml was set, forced linebreaks became <br/>.
Fixed by filtering out nonprinting nonwhitespace characters
on the input and using
^C
as the<br/>
generator character instead of converting the forced linebreak directly to<br/>
. - inline links (via
[]()
) didn’t allow spaces or escaped)
characters. Fixed by rewritinglinkyurl()
to absorb input until a terminator instead of until whitespace or a terminator, and allowing \ to escape ), =, or “.
- If -fautolink was turned on, a naked @ became a mailto:
link. Fixed by only triggering
- Changed the
Qchar()
function so that it take an integer argument instead of a char. (reported by Josh Wood from the plan9 port.) - Some bugs I discovered
- Flag the raw: pseudo-protocol so that it will be disabled when DENY_HTML is set.
- Rework
maybe_tag_or_link()
so it better rejects random stuff that begins with a<
. linkylinky()
was a horrible bug, and needed to be fixed (see item #5.)
- Add the new
abbr:
pseudo-protocol (the html<abbr>
tag) - Completely rewrite the
[]()
logic to get rid of some of the encrusted kludges which made 1.4.1pre0 into an festival of exploding code.