version 2.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 introduces a small collection of patches, bugfixes, and performance enhancements:
--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.)markdown
program, -f?
gives a list of the known flags.-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 <a name=
anchor I replaced it with (name=
is depreciated in xhtml, and may vanish.)version 2.0.7
finishes support for php markdown extra-style [footnotes]
by documenting them, fixing one small initialization bug,
and by creating the new public function mkd_ref_prefix()
which changes the name=
part of the forest of tags from
fn:N
and fnref:N
to {your prefix}:N
and {your prefix}ref:N
(allows someone to footnote individual articles on a weblog
where each article is rendered individually.)
A few manpage typos are also corrected thanks to a patch from Alessandro Ghedini.
version 2.0.6
adds preliminary (and undocumented, because I’m still
peering at the published interface and internal data
structures) support for php markdown extra-style
[footnotes] (disabled by
default; you enable them with the flag MKD_EXTRA_FOOTNOTES
.)
version 2.0.5
cleans up a long-standing compile-time warning, lightly tweaks
the table of contents generator (-ftoc
) to use <a name=
anchors instead of <h
Xid=
anchors, tweaks the librarian.sh
generator so it doesn’t require symbolic links to generate static
libraries, and expands the characters allowed in css class names
to include dashes and underscores.
version 2.0.4 corrects a few bugs, adds some chrome, and adds a few features.
--shared
in configure.sh
; FreeBSD, Linux, and MacOSX only for now.)makepage(1)
and mkd2html(1)
mkd_line()
, mkd_css()
and mkd_toc()
.mkd_generatecss()
; should be 1,size
, not size,1
.--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.version 2.0.3
updates the woefully out of date documentation describing
the various 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 fixes a couple of defects, adds more testscripts, and adds and updates a couple of features:
[]
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.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.<url>
has a known protocol prefix, it does not need a
leading //
after the prefix.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.)theme
, add the pseudo-tag <?theme config?>
, which writes a
listing of all of the runtime settings to the output file. If
<?theme config?>
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.)version 2.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
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 finishes the backtick handler cleanup started in version 1.6.7, so that it works like the reference implementation 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 <center>
…</center>
(not allowed
in xhtml, alas) it creates <p style="text-align:center;">
…</p>
,
which appears to work when centering images and text.
In addition in addition, I’ve added the <object>
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
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
repairs two defects, one in the markdown compiler and one in theme
:
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.
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 repairs six defects and adds two new features.
The bugfixes are:
_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.<style>
blocks as mystery node
during markdown -d
There is one race condition if you are using discount in a threaded environment; the code that initializes the blocktag list (for html blocks) has an internal test then set variable, but it’s not atomic, and it’s possible to either (a) have two threads go into that initializer at the same time and both attempt to initialize, or (b) have a second thread attempt to mark down some code while the first thread is still initializing. Either way it would produce hours of debugging fun.
To correct this defect, I’ve created the new function mkd_initialize()
,
which does all of the initialization. This function is called from
within the markdown parser (so existing code will still work) but if
you’re doing markdown from a threaded environment, you must call
mkd_initialize()
before you start spinning off threads.
And the features:
in relation to this, add the library function mkd_add_html5_tags()
,
which adds (globally, and non-removably) a handful of
new tags for html5 support.
There are actually two new functions here – mkd_add_html5_tags()
is a additional library function that will not be linked in unless
you demand it (or build the library as a dynamic library), and
mkd_define_tag(char * tag, int selfclose)
is a function that
allows you to add html tags as you wish (so you could, if you
wished, so something like mkd_define_tag("html", 0)
to treat
the contents of a html document as html) and which is used by
mkd_initialize()
to define the standard markdown html block
tags, mkd_add_html5_tags()
to add the narsty new html5 tags,
or any user-written function to add the tags you want.
It’s not threadsafe, so you need to define your tags before spinning off threads.
version 1.6.4 repairs a single defect (in the handling of html blocks), adds a pair of features (both via github,) and adds a couple of test cases to further excercise the code block handler changes from version 1.6.3.
The defect was that text following the closing tag of a html block would cause following content to be misprocessed (besides, of course, the existing defect that that text would not be processed.) The bugfix is that I now split following content into a new logical line, so input like
blah blah
foo
which used to output
blah blah
foo
now outputs
blah blah blah
foo
The (creeping) features are
're
, 'll
, 've', '
m', and 'd
so I sucked those
changes into the baseline code.lang:<whatever>
which would expand into
<span lang=<whatever>
…</span>
The additional testcases are to catch mishandled backslashes in code sections (most recently documented at http://code.reddit.com/ticket/695.) This defect was corrected in version 1.6.3, and I testcased it then, but more tests are always good.
version 1.6.3 repairs code section handling by the simple expedient of ripping most of the existing handlers out and replacing them with newer (and more dingus-compliant) code.
version 1.6.2 cleans up a couple of defects, adds manpages for the new callback functions introduced in version 1.6.0, and rewrites the emphasis generator (again) to make it work in a more xhtml-compliant manner when fed pathological emphasis.
The bugfixes are:
<a
tag._
or *
when they’re in the
middle of whitespace.[]()
link.<h6>
[]-<]:
won’t erroneously become
a footnote.version 1.6.1 fixes two scripting exploits, corrects three edge cases to make them work more like the reference implementation, and lightly modifies list handling to make it work a little more like the reference implementation (but, hopefully, without triggering the awful failure case that the reference implementation has.)
The two security holes that were fixed were:
<
then just copy the rest of the tag to the output
until I reached a ‘>’. So if someone did
<hi<script>attack<hi</script>
, the <script>
would be
dumped to the output just as prettily as you please."
and '
, so a malformed title string could contain
arbitrary text, up to and including scripts.The three compatability changes are:
<br/>
‘ed,And the tweak is to change how list items absorb new paragraphs. Discount traditionally would absorb new paragraphs if they were indented one level (4 space), and punt them back to the parent level if they weren’t indented that much. The reference implementation, on the other hand, captures new paragraphs into the preceding list if, apparently, they are indented at all. The people at github, who, apparently, are using Discount, have a bug report against list handling where
list indented 3 spaces
paragraph indented 3 spaces
doesn’t absorb “paragraph …” into the second list item. I have modified the indent handler to absorb items indented as deeply as the text on the preceding list item instead of requiring a 4 space indent. It doesn’t appear to break any of my test cases (markdowntest 1.0, markdowntest 1.0.3, and any of my flock of tests), and it allows for slightly more readable lists.
version 1.6.0 adds one new feature that’s large enough to require a version bump; I’ve now added callback routines so that a program that uses discount can
[]()
and <link>
constructs,
as well as[]()
and <link>
constructs.As an example, if you wanted to ensure that no urls were relative, you could set up a basename callback to add a prefix to every relative url (this was hardwired into discount prior to 1.6.0, but has been newly made into a callback.)
version 1.5.8 fixes two table bugs, and adds a marginally useful feature.
The bug fixes (one reported by Matthew Kennard, the other discovered when fixing that bug) corrected
The new feature takes advantage of a parsing glitch to
allow image scaling; you can specify the height or
width of the image by itself by giving a size of
“=x
W” (to set the width) or “=
Hx
” (to
st the height.) This was suggested by Val Schmidt at
UNH, and it’s a tiny change for adding new functionality,
so I couldn’t resist putting it in.
version 1.5.7 fixes one
bug that caused discount to crash. It turns out that if you
had an html block with an unclosed closing tag, the html
parser would run up to the end of input and then attempt to
return the next line. Which there wasn’t. So off we’d go
into null pointer reference land, which meant segmentation
violations and discount lying dead on the floor. This was
discovered by someone who was using the iPhone app Trunk
Notes
, and was then reported to me by Matthew Kennard,
(the developer and maintainer of that app.) The fix
was fairly simple, but it still requires a release to sweep
the nasty bug away.
version 1.5.6 makes four small changes;
configure.sh
test for bzero()
or memset()
bzero()
version 1.5.5 corrects a defect in the new table code where I was expanding an internal array instead of truncating it, and thus ending up with a table full of bogus numbers, which, if the proper build options were used, would make discount dump core.
Fixed, I hope, and I’ve done a brief code review of the unpleasantly complicated table code to try and verify that it won’t happen again.
version 1.5.4 corrects one
more defect; when I fixed the obscure, but long-standing [footnote]:
link defect in version 1.4.2, I ended up rearranging a
bunch of internal data structures. This broke the table of contents
code. It’s been fixed now, and I’ve added a test case for tables
of contents to ensure that it stays fixed.
version 1.5.3 corrects one
long-standing, but obscure, defect: I was treating
[text]
whitespace(text)
as a link,
when the standard implementation treats that as text. []()
is, apparently, only valid if there is no whitespace between
the ]
and the (
, and 1.5.3 corrects that misfeature.
Thanks to Bruce D’Arcus for reporting this defect.
version 1.5.2 corrects two long-standing defects, both of which are fairly obscure but which are still wrong.
The first defect was that you could not have consecutive >%div%
blocks, because the parser would treat the second block as a
blockquote continuation. 1.5.2 corrects that, and now
this is a class A div block
this is a class B div block
properly generates
this is a class A div block
this is a class B div block
The second defect dates back to the beginning of time,
discount-style; I had assumed that [footnote]:
links
were only valid if they were in a block by themselves, and
this is most certainly not the case. I had to rewrite
some of the parsing in markdown.c
(splitting the compile()
function into compile_document()
and
compile()
,) and
now code like
This is a paragraph with [footnote]: invisible! a surprise inside.
generates
This is a paragraph with a surprise inside.
while tucking footnote
away for later use. 1.5.2 does not
completely correct this defect – the
reference implementation will not treat
[footnote]:
as a link if the url part contains any whitespace,
while mine does no matter what – but aside from that, it makes
my implementation
work more like the reference at the cost of surprisingly few
cpu cycles.
version 1.5.1 corrects a
typo in the way I was generating tables (I had transposed
the </tbody>
and </table>
), briefly documents the this
feature, and adds the new flag MKD_NOTABLES
(-fnotables
)
to disable table processing.
version 1.5 includes support for PHP Markdown Extra-style tables, plus has a couple of minor tweaks to fix some bugs in the way list indentation is handled and list contents are blocked.
version 1.4.5 has some documentation cleanups (courtesy of Josh Wood) and has a few minor tweaks to the list handling to better handle indentation and paragraph wrapping of multiparagraph list items.
version 1.4.4 does some small feature cleanups, removes a few bug cases that crept in without causing test cases to fail, and rewrites all of the test cases so that they don’t rely on grep (and regular expressions) to work. No new features have crept in, but some of the existing new features have been reworked again to make them more stable (and work.)
version 1.4.3 goes back
into the code that handles []()
and rewrites it so that it
hews closer to the behavior of the reference dingus on some
bizarre edge cases. And, as an extra bonus, it includes a
Plan 9 support directory that contains a mkfile
and copies
of the markdown.1
and markdown.6
manpages rewritten in the
USG style.
The bizarre edge cases are ones that you don’t see in the
standard test suite. It turns out that if you have a
[]()
construct like [ouch!](http://MY 'BRAIN' HURTS)
,
the url should be http://MY 'BRAIN' HURTS
. This was
amazingly difficult to make work correctly, and it involved
several iterations of writing sample code and throwing it
away before I figured out (on a 50 mile bicycle ride) the
proper way of doing it (using regular-expression-style
backtracking, which is fairly expensive on pathological
edge cases, but which is fortunately quite cheap on well-formed
constructs.)
version 1.4.2 fixes a handful of bugs, rewrites some kludge-bespotted code, and adds a couple of features.
The features are:
abbr:
pseudo-protocol (the html <abbr>
tag)[]()
links are parsed so you can have URLs
that contain spaces and (properly escaped) ‘)’sThe bugfixes are:
maybe_tag_or_link()
on
alphabetic characters.^C
as the <br/>
generator character
instead of converting the forced linebreak directly to <br/>
.[]()
) didn’t allow spaces or escaped )
characters.
Fixed by rewriting linkyurl()
to absorb input until a terminator
instead of until whitespace or a terminator, and allowing \ to
escape ), =, or “.Qchar()
function so that it take an integer argument
instead of a char. (reported by Josh Wood from the plan9 port.)maybe_tag_or_link()
so it better rejects random stuff
that begins with a <
.The kludge-bespotted code was the contents of linkylinky()
(see
feature #2 and bug #3) which had reached the point where every
bugfix or feature addition would spin off another bug or two.
A complete rewrite later and it doesn’t appear to be spinning
off bugs, though I need to re-revisit some of the linkylinky()
logic to make it hew more closely to the reference implementation.
version 1.4.1 adds two new features suggested by Mike Schiraldi;
version 1.4.0 fixes a few
bugs in the way I was (mis)handling utf-8 characters, plus reworks
the published interface to add more methods to get data out in
non FILE*
form.
The style I am trying to follow is that output functions that
write to FILE*
s are named mkd_generate
x, while functions
that allocate and populate a string are named mkd_
x. I
didn’t do a very good job of this in the first place, and ended
up having rename a bunch of functions as I added the new ones.
To access embedded style sections, I supplemented the old mkd_style
(write style sections to a file) function with the new functions
mkd_generatecss
(== mkd_style
) and mkd_css
(allocate a
buffer and populate it with style sections.)
mkd_style
remains in the published interface,
but as a #define
to mkd_generatecss
To get xml-style output, I added the functions mkd_xml
(allocate
a buffer and populate it with the xml version of the input string)
and mkd_generatexml
(write the xml version to a FILE*
.) These
supplement the MKD_CDATA
flag, which makes the markdown()
function
write xml.
mkd_text
(parse a single block of text, write it to a FILE*
) is
renamed to mkd_generateline
(with mkd_text
remaining as a #define
)
and mkd_line
does the expected buffer allocation and population.
There are some documentation cleanups as well; many versions ago, I
had a MKD_QUOT
flag, which vanished but floated around in the documents
until now, and I’ve beefed up the description of some of the other
build and operational flags.
version 1.3.6 changes the way I parse raw html from the fairly rudimentary (but still test-passing) pattern matcher I had to a slightly more sophisticated blocking scanner. This means that the html block
(which used to capture all input up to the next line that contained
a solitary </div>
) now properly finishes the html block at the
expected place.
version 1.3.5 fixes one
bug (I’d messed up the code that handles >%class%
blocks,
so that an implicit >%class-title%
prefix would cause core
dumps on machines with sufficiently paranoid memory allocation,
and adds one enhancement to the build by prefixing all the
install paths with $(DESTDIR)
(so you can configure the
code to install into {destination}
, but then make install
it
into a sandbox and then tar up the contents of that sandbox and
extract it directly into {destination}
.)
version 1.3.4 has a couple of code changes it it; one to make it work better as a library, and the other to make it work better with a more recent version of the official markdown test suite.
mkd_toc()
which writes the table-of-contents xml into a
string instead of to a FILE*
; This is so Ryan Tomakyo’s
rdiscount ruby binding can include a table-of-contents
method on systems that don’t have the nonportable fopencookie()
[GNU] or funopen()
[BSD] stdio functions.[link][]
) without
the second (empty) []
on them. I have added the new flag
MKD_1_COMPAT
, which disables implicit reference links and puts
back the MarkdownTest_1.0 trailing whitespace bodge, so now both
the 1.0 and 1.0.3 test suites work (with appropriate function flags.)(Discount 1.3.3, which is now withdrawn, broke the “two trailing
spaces makes a <br/>
rule. Neither the two versions of MarkdownTest
nor my own test suite tested for these. Ooops on me!)
version 1.3.2 has no code
changes, just configuration ones – On Solaris, the tr
in
/usr/xpg4/bin
does not like the character ranges [a-z]
or [A-Z]
, and I
can’t just use [:upper:]
and [:lower:]
because it’s declasse
to do tr -dc [:upper:]
when you could instead run all the way
around Robin Hood’s barn to do the same thing with multiple
commands.
So I’ve changed configure to try the dumbest possible character ranges, and fail if enumerated sets, ranges, or bracketed ranges don’t work. And now it works on Solaris. Today.
version 1.3.1 modifies the
puturl()
function (used inside []
links) so that it doesn’t
url-encode printable characters aside from &
, <
, and >
version 1.3.0 documents the 1.3.0 changes, so that they aren’t simply little magic cookies left in the code as obstacles for the unwary.
version 1.3.0pre4 corrects a bunch of edge cases and misfeatures, and adds in a small raft of new experimental features, such as:
mkd_xhtmlpage()
function suggested by Tim Channon.
mkd_xhtmlpage()
takes
a markdown document and attempts to build a complete xhtml page out of
it, inserting the contents of any headers and
style blocks in the correct places.version 1.2.10 corrects a tiny
bug in [title](url)
and ![title](image)
links, where if the [title]
was empty the tag wouldn’t be expanded. Admittedly, it’s a good idea
to actually put a meaningful title in a link or image, but there’s no
reason to actually require it and I’ve cleaned up the code to reflect
that.
version 1.2.9, which includes:
MKD_NOHTML
, which blocks all embedded html and
forces the user to use the markup language for doing markup.RELAXED_EMPHASIS
so that it only applies to underscores
in the middle of words. This breaks the emphasis rules for things
like a_b
(or, if you’re describing code, thing like size_t
or time_t
or …) which may not be a problem for you if you’re writing
about code.# FOO
won’t generate
<h1> FOO</h1>
Version 1.2.9 was originally version 1.2.8, except that 1.2.8 was incorrectly published after git didn’t push the 1.2.8 changes back to my master repository. It pushed the VERSION file, which was something, but not the actual code changes.
version 1.2.7 contains two bugfixes and one new feature:
strget()
not properly returning EOF
because it was returning a char
or unsigned int
instead
of an int
(should be a signed int
, but that way lies C99
madness.) This bug was reported by A.S.Bradbury, who discovered
it when trying to build markdown with a 64 bit version of gcc.![]()
and/or
[]()
, where the content parser stops parsing 4 (for IMG) or 5
(for HTML) characters before the end of the embedded content.
This bug was reported by Christian Herenz, who has been finding
many many boundary condition bugs in the way ![]()
and []()
(don’t) work.--enable-superscript
turns on fancypants substitutions that translate word^word
into word<sup>word</sup>
. I’m not sure if it’s the most
useful thing in the world, but I have found cases where I’d
like to be able to get superscripts generated just by themselves.
(and since I don’t code in PASCAL any more, I don’t need to
worry about tripping over a dereferencing ^
as much as I
used to worry about it.)version 1.2.6 contains patches
to work around some of the broken features in Xcode on macos 10.5.
The AC_SUB
function in configure.inc
has been reworked to not
do echo -n
(because that one spits out ^?
when I echo an empty
string,) and I’ve had to write my own echo
because the builtin
echo
that the Xcode /bin/sh
(actually the gnu clone shell) uses
no longer accepts -n
as the “do not put a newline at the end of
this line, k?” switch.
There’s also another tiny bugfix: I discovered that if I had a
line of the form [link][] text text [link][]: ...
, it would
get treated like a footnote despite obviously not being one.
This release corrects the isfootnote()
function in markdown.c
so it won’t do that anymore.
version 1.2.5 fixes a small
bug inside <url>
’s, where the url would be parsed as if it was
text instead of being treated as code.
version 1.2.4 fixes a bug
which caused builds to fail if --enable-dl-tag
was not set;
I was combining code that required WITH_DL_TAG
and code that
didn’t, so a isdefinition()
call crept into unDL_TAG
territory.
To fix that bug, I moved the test for WITH_DL_TAG
into isdefinition()
and worked the code so that isdefinition()
always returns 0 if the
code was configured without --enable-dl-tag
.
version 1.2.3 fixes two
bugs in the markdown
program, fixes one bug inside the markdown
library, adds support for testing mkd_text()
inside the markdown
program (-t text
processes text
with mkd_text()
,) and adds
support for sequential <dt>
blocks with sequential =tag=
labels.
version 1.2.2 fixes two bugs;
[]
sections.version 1.2.1 cleans up a few more memory
leaks, adds a new function (mkd_document()
, which returns a pointer
to the compiled document,) adds the new configuration option --enable-amalloc
,
which builds against a debugging memory allocator, and, finally, it
rips into the guts of the second-pass of the compiler and rearranges
how *
and **
are compiled to (hopefully) guarantee that they will
never generate incorrect XML.
The “rip into the guts” part adds a half-pass to the second pass of
the compiler; htmlify()
now writes into a linked list of text and
emphasis tokens, which are then flattened into the output document
by the new function emblock()
which attempts to match emphasis
blocks up properly instead of the old-style “generate <strong>
and
<em>
blindly as we roll on down the line.”)
version 1.2.0 has two subtle output change,
plus a bugfix that steps on a memory leak in codeblock()
.
The output changes (which caused the minor# to go from 1 to 2) are
<html tag>
are now parsed as code, not as
text. This keeps <a href="linky">
from being written as
<a href=“linky”>
, and may thus confuse source
that was written with \"
’s to get around the smartypants
extensions.<email@address>
automatic links, ensure that
the human-readable part of the link doesn’t include a mailto:
,
just the mail address.version 1.1.5 contains assorted cleanups:
strcasecmp
vs stricmp
and strncasecmp
vs strnicmp
, thenblocktags[]
into
an array of struct kw
s and having isopentag()
construct a struct kw
and
use that for searching instead of malloc()
ing a buffer, making a null-terminated
string, then comparing against that, and, finallyalloca()
inside isopentag()
.version 1.1.4 adds some build tweaks to (hopefully) finally make the sample programs build on Windows.
version 1.1.3 adds a README
and
an INSTALL
file, plus tweaks the build process to not use
bzero()
[because it broke the gcc on macos] nor the revised
version of cstring.h
[because, surprise, it broke the gcc on
macos.]
version 1.1.2 adds support for quoting
link titles with (
…)
(as well as the regular "
and '
quoting formats), plus continues the possibly-doomed project
to make it portable to MS-DOS+mingw
systems:
bzero
, define bzero(s,n)
memset(s,0,n)
srandom
, define SEEDRNG(x)
srandom((unsigned int)x)
srand
, define SEEDRNG(x)
srand((unsigned int)x)
SEEDRNG(x)
(void)1
random
, define COINTOSS()
(random()&1)
rand
, define COINTOSS()
(rand()&1)
COINTOSS()
1
version 1.1.1 adds NO NEW FEATURES,
but simply adds an checks for pwd.h
and getpwuid()
to
configure.sh
, to make it slightly easier to build the code
on (mingw‘ed) MS-DOS systems.
version 1.1.0 adds a new output flag
(MKD_CDATA
) so that it can generate output suitable for
use as data in an xml document. This feature was added in
because it appears that the definitions for rss and atom
newsfeeds have shifted and I can no longer protect the contents
of a field by wrapping it in ![CDATA[
…]]
. In addition,
I’ve renamed the version field from version[]
to markdown_version[]
,
thus breaking the library interface but in a way that actually makes
the variable more useful.
version 1.0.0 is the first “yes, I’ve seriously nailed down the published interface and have been using the code enough to call it stable!” release (which will probably turn out to have some horrible flaw somewhere in it.)
There are not very many new features in 1.0.0; I’ve written a
manpage for theme(1)
, changed MMIOT
in mkdio.h
from a void*
to a void so it will more closely resemble the traditional FILE*
that stdio provides, and collapsed a couple of annoying buglets.
I’ve increased support for styles by handling style blocks
(<style>
…</style>
) 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 has support for the
raw:
, id:
, and class:
pseudo-protocols, plus has a
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 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 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.
#include <libgen.h>
unless the system has it.basename()
if the system doesn’t have it.#include <string.h>
in cstring.h so we can get the prototype for
memmove()
<img
tag more xhtml-friendly by ending it with />
.. . .
now maps to …, just like ...
does.codeblock()
– we need to be able to do
trailing spaces on regular paragraphs.The festival of final cleanups and bugfixes continues.
![][]
tag. Sheeesh!<orc@pell>
and <mailto:orc@pell>
automatic links.mkd_dump()
USES the output FILE*
now.smartypants()
converts 1/4
to ¼
, 1/2
to ½
, and
3/4
to ¾
. It also knows about ¼th and ¾ths.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.
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 fixes most of the remaining failures when running the test suite. It has a few more features as well:
--enable-pandoc-header
, and
turnoffable by passing the MKD_NOHEADER
flag to mkd_in()
or mkd_string()
.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.Various paranoia and edge-condition patches.
version 0.8.2 fixes two bugs that I found when I compiled the MacOS TextMate editor manual.
<table>
as a block html element.UTF-8
-encoded characters with bit 0x80
set were being
silently dropped from the input.version 0.8.1 has been tweaked so that it (mainly) passes the official markdown 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 <IMG tags into <IMG . |
MKD_NOLINKS | (0x01) | Disable [][] expansion, convert <A tags into <A . |
To run the test suite, I set MARKDOWN_FLAGS=0x4
to
stop those pesky smart quotes from messing everything up.
version 0.8 adds in a whole bunch of new features, so many that if I had nailed the published interface down this would be the time to roll up to version 1.0. In 0.8, I’ve:
--with-dl-tag
option.
The new markup is ^=tag=$, with the list item – indented
at least 4 spaces – beginning on the very next line.<code>
and <pre>
in code blocks.reparse()
dumptree()
) and modify the
markdown
program to use it when passed the -d
flag.markdown.c
in half; one half is the backend html
generator, the other half is the tree builder.mkd_text()
and markdown()
to return int
markdown(1)
.version 0.7.5 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 revisits the way lists are assembled
and finally gets them to work closer to the same way that they work
in the reference implementation. 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 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
<p>
’s aren’t wrapped around the <Hn>
…</Hn>
code. It shouldn’t
really matter, but I do look at the generated html and this bothered me.
version 0.4 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
<center>
<a href="/~orc/dustmite.jpg"><img src=http:/~orc/dustmite_t.jpg></a>
</center>
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, 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 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 started to define a published interface, so I could bolt it into annotations to see what would fall apart.
version 0.1 is the first public release