This Space for Rent

New Code!

Discount, after a leisurely 13 months of minor tweaks, configuration changes, and a few bugfixes, has been shovelled up to version 2.2.3 with the following Big List Of Changes:

  1. Have tools/branch be a no-op if there’s no git that I can use to check for my SCCS status.

  2. Add user-contributed cmake support

  3. check for non-null T(link) in the safelink function; rename paranoia.t to safelink.t, add a couple more tests for safelinks

  4. tweak the safelink detection code to allow more types of url fragments

  5. when finding the installer, check that -s works (doesn’t work on Minix 3?)

  6. Correct makepage & theme to use the new set_flag() return scheme (0==success, !0==pointer to bogus flag)

  7. if an unknown flag was in the middle of a comma-delimited flag string (like -flatex,bogus,footnote), the markdown program would incorrectly report the first flag as unknown (because set_flag returned 0 on error, 1 on success and the strtok() of the flag string had already replaced the commas up to that point with nulls.)

    Change it so that set_flag returns null on successful processing and a pointer to the offending flag on an unknown one.

  8. Tweak the install rule to install a GNU-style .pc file iff @MK_PKGCONFIG@ is not defined as #

  9. Hand-resolve a conflict in the msvc Makefile

  10. Add in paranoid list splitting [EXPLICITLIST] (the default behavior many many versions ago before I realized it wasn’t the standard) (and take the last of the 32-bit flag mask for it) between adjacent ordered and unordered lists.

  11. Create a utility function [notspecial()] for theme & mkd2html – check a filename to see if it’s a special file that doesn’t need to be deleted or to have a .html suffix added to it. It only works on machines that have a stat() system call + the S_ISFIFO, S_ISCHR, and S_ISSOCK macros, otherwise it thinks that nothing is special.

  12. Add a README for the utilities in the tools subdirectory

  13. Add the git branch name into the version string if we’re not on the master branch.

  14. Add support for NMAKE and Visual C++ toolset. (courtesy of Martin Hofmann (tin-pot) fork of Discount).

  15. Add a ‘dirty’ flag to the Document structure & set it whenever a callback changes (github issue #136) so that the next mkd_compile will regenerate the document.

  16. Tweak superscript handling to be able to superscript something wrapped in html

  17. Tweak the show_flags() function so that if it’s called verbosely it will show synonyms for named flags. (Calling it verbosely is done by the V option, which is overloaded for verbosity when listing flags.)

  18. Process html blocks in compile (as well as in compile_document(); compile_document() needs to handle <style> blocks and compile() needs to handle html blocks that are nested inside blockquotes, tables, lists, &tc.

  19. Add –h1-title as an option to configure.sh; this enables code that uses the first h1 in a document as the document title (in mkd2html & theme)

  20. add gethopt() – a q&d getopt clone that accepts both full-word & single character options – instead of doing kludgy bespoke argument parsing in mkd2html & theme.

The only big change (one that changes how Discount renders code) is the MKD_EXPLICITLIST options flag which breaks the standard markdown behavior of merging adjacent numbered & bulleted lists. This was added because EVERY SINGLE MARKDOWN CLONE (except discount) apparently does not render lists the same way that the reference implementation does, and since the code was already there it was easy for me to option flag it back into functionality.

This horrible piece of code™ is sadly in need of some properly written documentation, but, alas, that is not to be found in this release. Maybe this summer? But until then, why not try it out? It still runs on modern Unix clones (macos, centos, debian), elderly Unix clones (freebsd 4.8), it’s been ported to Minix 3, and it apparently still builds on Windows (though I don’t have a windows build environment for it as of yet) and it probably won’t set your laptop on fire.