New Code!
Discount has been rolled up to version 1.1.0 with the addition of one new feature, a few tiny tweaks, and a small bugfix.
The bugfix involves breaking the published interface, but in a good way; in version 1.0.0, I published the string containing the version number under the name
version[]
, which, although accurate, is a much too generic name. In version 1.1.0, this has been renamed tomarkdown_version[]
.The tweaks are
- I modified the behavior of
\\
-escapes so that they will only escape characters that might have special meaning to the markdown language. This means that other escapes, like\n
, don’t need to have the \ doubled anymore. - The entity
�
has been redefined to be a zero-width token break, so I can write 10½ (10�1/2
) without having to resort to writing raw html entities. - The internal
EXPAND()
macro has been restructured to explicitly order code execution, at least with compilers that attempt to compile C as C code. configure.sh
now attempts to detect the presence of gcc, so I can attempt to work around gcc redefinitions of the C programming language.
- I modified the behavior of
The new feature is the addition of the
MKD_CDATA
output flag, which tells discount to attempt to produce output that can be used as data inside an xml document (rss and atom feeds in particular; the syntax for feeds is distressingly fluid and it appears that![CDATA[
…]]
blocks don’t escape as well as they used to.) If I setMKD_CDATA
, all<
s expand to “<
”,&
s expand to “&
”,>
s to “>
”,"
s to “"
”,'
s to “'
”, and all non-ascii characters are silently dropped on the floor.
Discount still passed the standard markdown test suite, and it doesn’t appear to blow up when I use to to regenerate html pages and write articles in this weblog, so it’s New Code! for one and all to play with on this grim and horrible monday morning.