This Space for Rent

New Code!

Discount has (finally) been rolled up to version 1.3.0 with the addition of documentation for all of the new features I put in for the 1.3.0prexxx series.

To recap the feature list, I’ve added

  1. In the theme program, if I pass it a directory argument it will attempt to open the file index in that directory.
  2. Add the flag MKD_STRICT, which disables superscript (A^B ≠ AB) and sane handling of A_B
  3. Add blockquote-as-division processing; a blockquote that has a first line of >%ident% expands to

     <div class="ident">
           .
           .
           .
     </div>
    

instead of the traditional

    <blockquote>
          .
          .
          .
    </blockquote>
  1. Extend list processing to enable alphabetic lists;

     a. this
     b. is a
     c. test
    

    expands to

     <ol type=a>
     <li>this</li>
     <li>is a</li>
     <li>test</li>
     </ol>
    

    (enabled with -enable-alpha-list)

  2. Add table of content support; if discount is run with the MKD_TOC flag, <hN>’s are name=d, and the function mkd_generatetoc() will dump a nested list containing links to every header in the document.
  3. Add the new function mkd_xhtmlpage(), which dumps the document wrapped in a skeletal html page, with the title taken from the header block and styles taken from any <style> blocks.
  4. Add the new demo program makepage, which is a program wrapper around mkd_xhtmlpage()

And I’ve fixed a few bugs and boundary conditions:

  1. Single-character ETX headers now work.
  2. Null lists don’t cause core dumps any more.
  3. Don’t set subblock paragraph alignment unless that subblock actually has content.
  4. Zero the input buffer every time I finish processing it (I was getting lookback errors with relaxed emphasis.)
  5. An inline code block now needs both beginning and ending `’s
  6. When processing lists, don’t kick header blocks out of the line.
  7. Correct list processing so that
     - A
     1. B
    

    produces a single <ul> list, not a <ul> list followed by a <ol> list.

  8. Do not superscript items inside a title.
  9. The line ## should now expand to <h1>#</h1>

Have I missed anything? Perhaps I have, but there’s only one way to find out – grab this New Code! and see if the smoke comes rolling out of your computer or not.