% Discount -- source for older releases % Jessica L. Parsons % Mon Feb 25 10:48:09 PST 2008 #Older versions of Discount# * [[version 2.0.9](discount-2.0.9.tar.bz2)](id:v2.0.9) puts in a workaround for a Linux security misfeature; some of the commercial hosting services set up `/tmp` so that it's mounted `noexec`, which means that when `configure.sh` attempts to run a little test program to find scalar sizes, it can't do it and ends up failing. So `configure.sh` has been patched to put temporary executables that need to be executed into the working directory instead. * [[version 2.0.8](discount-2.0.8.tar.bz2)](id:v2.0.8) introduces a small collection of patches, bugfixes, and performance enhancements: * Table processing was modified to make it hew closer to the markdown extra implementation * Optimized the code that's used to look for tables by scanning for pipe symbols when I'm reading data into the input lines array. * Documentation patches from David Banks * argument prototype tweaks for Solaris, from Allen Otis * `--with-github-tags` configuration option to to include `-` and `_` in the acceptable characters for `maybe_tag_or_link()` (code from Ryan Tomayko's discount SCCS on github.) * in the `markdown` program, `-f?` gives a list of the known flags. * also, `-F?` gives a list of the known flag bits. * `--with-id-anchor` configuration options to have the table of contents code emit `id=` instead of the dummy ` 4 for enumerated lists; this means that I have to test and cut back large indents and change my test cases to account for leading whitespace on deeply (2 spaces + enumerated marker + 1 space) indented items. 13. Add a raft of testcases to cover the new features + bugfixes. 14. Add markdown extra style definition list support * Add a configuration flag (`--with-dl=`{**discount|extra|both**} to select which way to do definition lists. Put a `DL=` into version.c so the user can see how this is configured. * If dl is turned off at compile time, mark it off in version.c * [[version 2.0.3](discount-2.0.3.tar.bz2)](id:v2.0.3) updates the woefully out of date documentation describing the various [`MKD_` flags](#mkd_flags) available in the published interface. As a little bit of chrome, it also modified `mkd_document()` to put a trailing null at the end of the buffer containing the generated document. * [[version 2.0.2](discount-2.0.2.tar.bz2)](id:v2.0.2) fixes a couple of defects, adds more testscripts, and adds and updates a couple of features: 7. Fix a glitch in new-style `[]` processing that would collapse two sequential new-style `[link]`s into one no matter how much space was between them. The reference dingus only coalesces adjacent new-style `[link]`s together if they are physically adjacent or have one space between them. 5. Modify superscript grabbing so that it grabs parenthetical and alphanumeric blocks 6. Rework (again!) the guts of `linkylinky` to support markdown 1.0.2b8-style `<`..`>` links: these are like the original format I implemented before I rolled them out while chasing compatability in that a url starting with '<' contains _all characters_ until an unescaped '>' is encountered. 3. Change the autolink prefix to closer fit to the reference dingus; if a `` has a known protocol prefix, it does not need a leading `//` after the prefix. 2. Add a couple of functions that write the current runtime configuration (either a flags value (`mkd_flags_are`) or of an MMIOT (`mkd_mmiot_flags`)) to a FILE. `markdown -VV` prints out the flags for now, and the functions are there for other people to use as they desire (see below.) 1. In `theme`, add the pseudo-tag ``, which writes a listing of all of the runtime settings to the output file. If `` is called from the header section of `page.theme`, it writes the runtime settings in `markdown -VV` format, otherwise it writes a two-column html table (regrettably this will not work from inside generated content; theme is kind of stupid that way.) 4. Add test cases for <> links (regular and markdown 1 compat), split the superscript tests out from smarty.t * [[version 2.0.1](discount-2.0.1.tar.gz)](id:v2.0.1) fixes a newly introduced bug in `_` handling (I flaked out and reversed the test for relaxed emphasis, but hadn't updated the testcase to account for the new runtime configuration for relaxed emphasis,) plus adds a pair of test cases for table of contents support. * [[version 2.0](discount-2.0.tar.gz)](id:v2.0) fixes one bug in table-of-contents handling (it would dump core if a header item contained a link), fixes the automated labeller so that it creates valid xhtml `id` attributes, and (by the simple expedient of breaking the published interface by expanding the flags field from an int to an at least 32 bit scalar (to fit the 22-and-counting option flags that discount now has)) restructures the code so that the only things that are compile-time options are memory allocation debugging and proper tab settings. It's a `.0` release, of course, so there may be some horrible bugs just waiting to fall out in the places I've not written test cases for yet, but there are many advantages to having the vast majority of the features be settable at runtime and I decided that this was a good time to make the change. * [[version 1.6.8](discount-1.6.8.tar.bz2)](id:1.6.8) finishes the backtick handler cleanup started in version [1.6.7](#1.6.7), so that it works like the [reference implementation][reference dingus] does, and adds in strikethrough support. The strikethrough support is a common extension format; you enclose the text you wish to strikethrough with string of (two or more) tildes, like `~~this~~`. The syntax for strikethrough is, with the exception of needing two or more tildes, identical to the syntax for backticks; you need to have at least as many opening tildes as you do closing (extra opening tildes are put inside the struck-through code, so `~~~orc~~` becomes ~~~orc~~.) If you don't want strikethrough, the flags MKD_STRICT or MKD_NOSTRIKETHROUGH disable it (I am shifting away from using configure-time options to enable/disable extensions; If I compile them in _all the time_, it makes it easier to do regression and crash testing inside my automated test suites.) In addition, 1.6.8 cleans up the html generated by the `->`...`<-` extension; instead of creating `
`...`
` (not allowed in xhtml, alas) it creates `

`...`

`, which appears to work when centering images and text. In addition in addition, I've added the `` tag to the list of html blocks that discount will not attempt to process, and I've attempted to update the manual pages to reflect some of the recent additions to the codebase. * [[version 1.6.7](discount-1.6.7.tar.bz2)](id:1.6.7) repairs one defect in backtick handling, where if a code span was closed by more backticks than it was opened with discount would consume the starting characters within the code span ( so \`\`foo\`\`\` would become \oo\ instead of \foo\\`.) Ooops. This was a simple case of mishandling the tick matching so that if the # of opening ticks was different from the # of closing ticks I would set the # of ticks to consume to the # of closing ticks no matter what. 1.6.7 corrects this feature. * [[version 1.6.6](discount-1.6.6.tar.bz2)](id:1.6.6) repairs two defects, one in the markdown compiler and one in `theme`: 1. In `theme`, I needed to take into account the source filename might not have an extension when I'm making the `.html` filename. The old behavior was to look for a dot and put the `.html` after that, but _I didn't check to see if there was actually a dot there_ before appending the `.html`! This did not work out too well if there was no dot. 2. In the markdown parser, I wasn't handling escapes of the open square bracket inside a `[]()` construct. So a link like `[foo\[and\]bar](does not work properly!)` would not parse because my square bracket matcher would look for an additional `]` to match the `\[` inside the `[]` part. * [[version 1.6.5](discount-1.6.5.tar.bz2)](id:1.6.5) repairs six defects and adds two new features. The bugfixes are: 1. properly handle html comments w/o spaces 2. fix nested list handling with unindented list items. 3. Add config.h to the dependency lists for cols & echo, so those functions will properly rebuild after a reconfig. 4. More plan9 fixes from Josh Wood; this one adds the flag `_C99_SNPRINTF_EXTENSION` to tell the APE cc that, yes, I do really want to be using snprintf() and I know that C99 has it return the size it wants to populate. 5. don't describe ``) by parsing them into a separate bin so they can be retrieved with the `mkd_style()` function. But the big thing is that I've officially nailed down the interface under the hopes I don't find Yet Another Thing that will cause the whole shebang to go obsolete. * [version 0.9.7](discount-0.9.7.tar.gz) has support for the `raw:`, `id:`, and `class:` pseudo-protocols, plus has a [theme](/~orc/Code/ragbin/theme) clone added as an example program. 0.9.7 may end up being 1.0 after I document it. I've used the current version of markdown to re-markup [my homepage](/~orc) and I've got it in the copy of [annotations][] that's running on the weblog server, and it seems stable. * [version 0.9.6](discount-0.9.6.tar.gz) is where I finally snapped and found a better workaround for the nasty tabstop feature in the standard. I've added the configuration option **`--with-tabstop`** which tells markdown to properly expand tabs to eight spaces, then added in another input flag (**`MKD_TABSTOP`** [0x0200]) that can be set when you have to use markdown on input that's written using the standard (but still wrong) 4 space tab. * [version 0.9.5](discount-0.9.5.tar.gz) 1. lowercase tag names for better compatability with anal-retentive newer web standards. 2. clean up the usage comment and example in the header. 3. * In mkd2html, don't `#include ` unless the system has it. * Also in mkd2html, define a `basename()` if the system doesn't have it. 4. Trim back leading spaces when returning fields from the document header. 5. `#include ` in cstring.h so we can get the prototype for `memmove()` 6. Update the mkd2html test program. 7. Make the ``. 8. `. . .` now maps to …, just like `...` does. 9. Move the line trimming into `codeblock()` -- we need to be able to do trailing spaces on regular paragraphs. * [version 0.9.3](discount-0.9.3.tar.gz) The festival of final cleanups and bugfixes continues. 1. Put most of the smartypants entity replacement strings into a table and do one table lookup instead of a bunch of individual tests. 2. I _reversed the order_ of height and width in the =*width*x*height* processing part of a `![][]` tag. Sheeesh! * [version 0.9.2](discount-0.9.2.tar.gz) * the particular type of whitespace is not important when matching footnote tags ( "this\\nis" matches "this is", for example.) * handle both `` and `` automatic links. * `mkd_dump()` **USES** the output `FILE*` now. * quoted blocks are no longer parsed as toplevel blocks now that toplevel blocks have different paragraph handling. * `smartypants()` converts `1/4` to `¼`, `1/2` to `½`, and `3/4` to `¾`. It also knows about 1/4th and 3/4ths. * [version 0.9.1](discount-0.9.1.tar.gz) 1. Remember that I said that the version 0.9 published interface was now a "version 1.0 release candidate?" I lied. The 0.9 published interface was carrying around a dependency on an internal data structure that was not publically defined, so I had to rearrange the published interface to get that back into the library space where it belonged. And in addition to that I needed to add the accessor functions for the [document header][] fields, so the poor interface was doubly whacked. Given any luck, the 0.9.1 published interface will be the version 1.0 release candidate. I certainly don't want to have to go back and redo all of the other code that calls the existing public functions again. 2. And, on a slightly less destructive note, version 0.9.1 **passes John Gruber's test suite** and I only had to put two horrible hacks in to make it conform to the standard. * [version 0.9](discount-0.9.tar.gz) fixes most of the remaining failures when running the test suite. It has a few more features as well: 1. I now support [Pandoc header blocks][document header] -- enabled during configuration with `--enable-pandoc-header`, and turnoffable by passing the `MKD_NOHEADER` flag to `mkd_in()` or `mkd_string()`. 2. The published interface is now a version 1.0 release candidate. I've expanded it to allow finer-grained access to the compilation process: =`mkd_compile()`= compiles the output of `mkd_in()` or `mkd_string()`. It is a boolean function that returns yes/no, depending on whether it compiled the code. =`mkd_generatehtml()`= generates html from the compiled input doc. =`mkd_cleanup()`= cleans up all of the data structures associated with the input doc. 3. Various paranoia and edge-condition patches. * [version 0.8.2](discount-0.8.2.tar.gz) fixes two bugs that I found when I compiled the MacOS [TextMate][] editor manual. 1. I forgot to define `` as a block html element. 2. `UTF-8`-encoded characters with bit `0x80` set were being silently dropped from the input. * [version 0.8.1](discount-0.8.1.tar.gz) has been tweaked so that it (mainly) passes the official [markdown test suite][test suite]. There are a bunch of minor tweaks to correct places where 0.8 failed to pass the test suite, and now 0.8.1 passes 16 of 19 tests where 0.8 failed 15 of 19 tests. I added a magic enviroment variable to to `markdown` program to tell it whether to enable or disable [smartypants][], links, or images. **`MARKDOWN_FLAGS`** is a bitmask consisting of: `#define` | bit | what does it do? -------------|----------|--------------------------------------- MKD_NOHEADER | (0x0100) | Do not process the [document header][]. MKD_NOPANTS |(0x04) | Disable [smartypants][] processing. MKD_NOIMAGE |(0x02) | Disable `![][]` expansion, convert `` and `
` in code blocks.
     4. Properly inherit from the parent frame in `reparse()`
     5. Add a parse tree dumper (`dumptree()`) and modify the
        `markdown` program to use it when passed the **`-d`**
        flag.
     6. Rip `markdown.c` in half; one half is the backend html
        generator, the other half is the tree builder.
     7. Change `mkd_text()` and `markdown()` to return `int`
     8. Write a manpage for `markdown(1)`.
     9. Completely rework the way whitespace is handled.  It is
        now a paragraph *separator*, not a terminator.
    10. Configuration cleanups to make it happier on more platforms.

  * [version 0.7.5](discount-0.7.5.tar.gz) bumps up 0.7 after 12 hours
    because I wasn't happy with the way that `title=` and `alt=` were
    being encoded, so I switched over to do doing a generalized reparse
    of those fields instead of having a custom parser (I was trying to
    encode "Le Gâteau Noir", and it mangled the â into a
    literal `&acirc;`.  This would not do, so I had to fix it.)

    As a happy coincidence, this let me clean up a few of the places
    where I had a collection of functions that did *almost* the same
    thing and replace them with calls to the one function with a new
    flag setting to turn off and on the one difference (expanding "
    into `"` is important when you're inside a `title=` or `alt=`,
    but not important anywhere else. I _could_ just have " expand
    everywhere, but the generated html is not quite so readable that
    way.)

  * [version 0.7](discount-0.7.tar.gz) revisits the way lists are assembled
    and _finally_ gets them to work closer to the same way that they work
    in the [reference implementation][markdown].   I have also gone over
    the output and made it so that text inside embedded urls and images
    (`[]` and `![]`) has `&` and `<` escaped in the output.

  * [version 0.6](discount-0.6.tar.gz) cleans up some bugs and includes
    the start of an automated test suite.

    Version 0.4 had a couple of buglets in it that would
    cause markdown to dump core if I had a dangling list item or a >-quoted
    paragraph as the last paragraph in a list.   After fixing those bugs,
    I decided that this was a good time to start writing an automated test
    suite so I could type ``make test'' and have all of the hopefully-fixed
    defects passed through the mill without any further human intervention.

    As an aside, I've cleaned up the code for `##headers##` so that extraneous
    `

`'s aren't wrapped around the ``...`` code. It shouldn't really matter, but I do look at the generated html and this bothered me. * [version 0.4](discount-0.4.tar.gz) fills in some more of the requirements for using it as the formatter for [annotations][] -- I am now reparsing the description field in `[link][fields]`, so if _link_ contains text that wants to be marked up it will be. I use it for things like ->[![dust mite](http:/~orc/dustmite_t.jpg)](http:/~orc/dustmite.jpg)<- Which formats down to

Without forcing me to go through the sort of quoting gymnastics I had to do with the old home-grown [annotations][] formatter. I cleaned up a small wad of boundary conditions when I did a code tidying sweep, and a few others when [annotations][] started dumping core when I would edit a post. And, finally, 0.4 includes a nroff-ed translation of [John Gruber][]'s [Markdown][] [language definition](http://daringfireball.net/projects/markdown/syntax), which was a fun-filled hour or so tour through the _interesting_ ways that groff can make a Macbook go to 100% cpu usage. * [version 0.3](discount-0.3.tar.gz) is a cleaned up version of 0.2. I didn't like the version 0.2 published interface, so I discarded it and wrote a new one from scratch. The published interface now consists of `markdown(void* blob,FILE*out,int flags)`, `void* mkd_in(FILE*in)`, `mkd_string(char*bfr,int size)`, and `mkd_text(char*bfr,int size,FILE*out,int flags)`. `markdown()` is the full-document formatter (the input blob is assembled by `mkd_in()` or `mkd_string`), and `mkd_text()` does simple markup (no code sections, no pure html, no quoting) on the input string. Version 0.3 also has a manpage for the published interface, and a little demonstration program (named, intuitively, *markdown*) that is a formatting pipe filter. * [version 0.2](discount-0.2.tar.gz) started to define a published interface, so I could bolt it into [annotations][] to see what would fall apart. * [version 0.1](discount-0.1.tar.gz) is the first public release [Mike Schiraldi]: http://mikeschiraldi.blogspot.com/ [PHP markdown extra]: http://michelf.com/projects/php-markdown/extra/ [Ryan Tomakyo]: http://tomayko.com/ [annotations]: /~orc/Code/annotations [css]: http://www.w3.org/Style/CSS/ 'See this page? This is how NOT to do styles' [discount]: /~orc/Code/discount [document header]: http://johnmacfarlane.net/pandoc/README.html#title-blocks [github]: http://github.com/Orc/discount [john gruber]: http://daringfireball.net [markdown extra definition list]: http://michelf.com/projects/php-markdown/extra/#def-list [markdown]: http://daringfireball.net/projects/markdown [old test suite]: http://six.pairlist.net/pipermail/markdown-discuss/2004-December/000909.html [pandoc]: http://johnmacfarlane.net/pandoc/ [plan9]: http://plan9.bell-labs.com/plan9/ [rdiscount]: http://tomayko.com/writings/ruby-markdown-libraries-real-cheap-for-you-two-for-price-of-one [reference dingus]: http://daringfireball.net/projects/markdown/dingus [smartypants]: http://daringfireball.net/projects/smartypants/ [syntax]: http://daringfireball.net/projects/markdown/syntax [test suite]: http://six.pairlist.net/pipermail/markdown-discuss/2004-December/000909.html [test suite]: http://six.pairlist.net/pipermail/markdown-discuss/2006-June/000079.html [textmate]: http://macromates.com/ [vi]: http://thomer.com/vi/vi.html