69 Commits
Author SHA1 Message Date
david parsons 27440b2e2f Add an int to the register c in linkytitle() 2009-06-17 08:45:57 -07:00
david parsons ade41b33d7 1. Reorder the logic of maybe_tag_or_link() to process mailto: before
other link types, and explicitly if() ... else the control flow
2. make the protocols[] array into an name/size structure, so I don't
   have to spend time doing strlen() when running isautoprotocol().
2009-05-30 12:53:47 -07:00
david parsons 8cf43729c1 Revert the alpha list marker to x. 2008-09-21 22:22:48 -07:00
david parsons c091e3c1f3 Change the alpha list flags from (x) to x) 2008-09-21 22:17:46 -07:00
david parsons 9ffcf10829 Fix the start condition for isfootnote(); add a
test for valid footnotes to tests/footnotes.t
2008-05-23 21:46:07 -07:00
david parsons 1d91c09fcd Version 1.2.5: use puturl() to write out auto-expanded <url>
and <mailto> sections.  If I use reparse(), I end up having
unhappy side-effects on the visible part of the url or mailto.
2008-05-16 14:51:11 -07:00
david parsons c6f592b143 Merge ../o.discount 2008-04-15 22:50:30 -07:00
david parsons 9ef05a4b03 Fix the commentary regarding the cdata flag setting. 2008-04-15 22:50:27 -07:00
david parsons e37a9b1015 Forgot to let mkd_text() write data in xml format. 2008-04-14 23:52:23 -07:00
david parsons 59925326bd Add a testcase for reparsing 2008-04-14 01:52:07 -07:00
david parsons d9b09d2046 Beat up on the code to make the MMIOT in reparse() inherit the parent
bookmarks.
2008-04-14 01:49:34 -07:00
david parsons d53cdb4ec3 Screwed up a printf() and attempted to use %s on a number. 2008-04-10 19:58:40 -07:00
david parsons 50362dd1e8 Don't #include amalloc.h out of mkdio.h 2008-04-10 17:10:17 -07:00
david parsons db71020b14 Forgot to add this file. 2008-04-10 16:51:25 -07:00
david parsons 0f4ded4986 In mkd_text(), I need to
1. not put out a trailing newline, and
 2. `emblock()` the token list to get my output.
2008-04-10 16:01:28 -07:00
david parsons ed662dfea3 Implement a somewhat better way of handling embedded emphasis,
by writing compiled output into a token queue, then running
an emphasis maker on that queue.  The token queue is an array
of TEXT and EMPHASIS tokens -- `TEXT` being what you'd expect,
and `EMPHASIS` holding counts of consecutive emphasis characters.

It's easier to explain with pretty pictures:

During the process of compiling the string `***HI***`, it gets
broken into five tokens:

1. TEXT `<p>`
2. EMPHASIS `*`3
3. TEXT `HI`
4. EMPHASIS `*`3
5. TEXT `</p>`

and then pasted together into a compiled document.  During the
pasting, emphasis tokens are paired with the next matching emphasis
token, then rewritten into two text sections (opens & closes) which
are treated as normal text during the pasting.

The above tokens are processed like so;  first to

1. TEXT `<p>`
2. EMPHASIS `*`1 [] [`<strong>`]
3. TEXT `HI`
4. EMPHASIS `*`1 [`</strong>`] []
5. TEXT `</p>`

then to

1. TEXT `<p>`
2. EMPHASIS `*`0 [] [`<strong><em>`]
3. TEXT `HI`
4. EMPHASIS `*`0 [`</em></strong>`] []
5. TEXT `</p>`

which is then concatenated to

    <p><strong><em>HI</em></strong></p>

And Bob's your uncle.
2008-04-10 15:49:19 -07:00
david parsons 4cd2ad9dcb Fix another bug -- I wasn't sizing the header properly
in `realloc()`
2008-04-03 11:42:27 -07:00
david parsons 44376ed97c Correct the (broken) header for afree() 2008-04-03 11:34:31 -07:00
david parsons fb1804d0f4 Add additional ()'s in EXPAND() to make certain that we don't run wild allocating memory while
building up a string.
2008-04-03 11:32:19 -07:00
david parsons 1a07e04f81 Don't malloc() a closetag buffer in htmlblock -- we know(tm) that
the close tag won't be longer than MAXTAG (the size of the longest
known block tag) so we can preallocate a buffer and just write into
it.
2008-03-14 23:28:04 -07:00
david parsons ec79f73f3e Expand the collection of escapes that actually work (to match
the markdown test suite)
2008-02-18 10:24:17 -08:00
david parsons 874d832499 Merge ../o.discount
Conflicts:

	generate.c
2008-02-18 10:19:00 -08:00
david parsons 6119a739a0 Version 1.1.0
-------------
 1. Add MKD_CDATA, which tells markdown to massage the output so it's
    good as data in an xml file (an rss or atom feed, most likely)
 2. more data massaging for characters in a url.
2008-02-18 10:14:56 -08:00
david parsons 22603e09c1 Tweak the changes to puturl() so that it will pass the standard
Markdown test suite.
2008-02-18 09:56:55 -08:00
david parsons e502c66474 Version 1.1.0
*************
 1. add the flag MKD_CDATA, which tells markdown() to sanitize
    the output so it can be used as data in a xml document.
 2. encode possible control characters in urls.
2008-02-18 09:49:06 -08:00
david parsons 5a35602116 SAMPLE_PGMS, not SAMPLE_PROGRAMS 2008-01-19 11:24:03 -08:00
david parsons 96e381bd8d Along with splitting PGM into PGM and EXAMPLE_PGM, don't forget
to delete the both of them during ``make clean''
2008-01-19 11:23:14 -08:00
david parsons 4491c67023 Add test cases for styles & pseudo-protocols 2008-01-19 11:20:19 -08:00
david parsons 4aa896d833 Add a manpage for my markdown extensions. 2008-01-19 01:24:47 -08:00
david parsons d5266835af Forgot a comment in the xref section of mkd-functions.3
Add the -V option to theme
2008-01-19 00:29:16 -08:00
david parsons 620cabd405 Forgot to hyphenate mkd-functions.3 and mkd-extensions.7 2008-01-19 00:26:10 -08:00
david parsons c8b8c52890 Update the manpages to follow the latest published interface,
add a manpage for new functions, modify the makefile to add
a rule to install example programs (just theme for now) and
modify the manpage installer to add links to mkd-functions(3)
2008-01-19 00:24:44 -08:00
david parsons cce907699b Messed up the exclusion flags in linkylinky(), which killed [![][]][]
links.   Also add another test for 't smartypantsing.
2008-01-18 22:18:58 -08:00
david parsons 186eb7ca5a The smartypants code was checking smarties _after_ doing quote
substitution.  This messed up 's and 't.
Also make <?theme include(x)?> actually work.
2008-01-18 15:31:42 -08:00
david parsons fa43fd7e27 Support <?theme include(file)?> 2008-01-18 14:04:20 -08:00
david parsons da30b6224f Check more carefully about inside tag/outside tag changes; if we're inside
tag text, emphasis and linkylinky isn't anymore.
2008-01-18 11:18:00 -08:00
david parsons 614ac7cf5e When dumping <style> lines, don't forget to put a newline
at the end of every line.
2008-01-18 10:29:23 -08:00
david parsons 0cdbbea9f9 Add support for <style> and <script> html blocks.
`<script>` blocks are added by the simple expedient of adding "`SCRIPT`" to
the blocktags[] table, but `<style>` blocks need to be written into the
document `<head>`, so they have to be stored as a different type and
output with the new function `mkd_style()` and **not** by `mkd_generatehtml()`
2008-01-17 12:38:40 -08:00
david parsons 0f2e5bc28c This will be version 1.
Use the new flag MKD_NO_EXT to disable pseudo-protocols.
2008-01-16 21:09:39 -08:00
david parsons 04e575dd0e Pad the ``alt='' part of the image tag pattern 2008-01-16 17:22:57 -08:00
david parsons 417894d36e Add a new internal function parenthetical() to push the whole "deal with
possibly nested tags and labels" thing off to a common subfunction.
2008-01-16 17:20:58 -08:00
david parsons 37044fd38d In linkytitle(), a ) shouldn't drop out of the title string unless at
least two quotes have been seen.
2008-01-16 16:56:58 -08:00
david parsons 760a0cb623 Strip out the debugging, okay? 2008-01-15 22:46:22 -08:00
david parsons b1924b31b3 In listitem(), set indent to 4 when a new paragraph starts. 2008-01-15 22:45:56 -08:00
david parsons 40700810e2 Add testcases for linky-alike [parenthesis], id: pseudo-protocol, class:
pseudo-protocol, and lists with blockquotes in them.
2008-01-15 22:41:55 -08:00
david parsons fdefb97247 Messed up the indentation for unnumbered list. It should be
min(4,nextnonblank(dle+1)) but it was dle+2 instead.
2008-01-15 22:32:44 -08:00
david parsons 9cc6ce1b4f Support the id:, class:, and raw: (support is incomplete) protocols
into `linkylinky()`
2008-01-15 20:28:57 -08:00
david parsons 3085332025 Don't zero the input stream when pull() reaches EOF; we might need to seek back towards the beginning later on. 2008-01-15 18:35:35 -08:00
david parsons 841101bbc6 theme pulls document author and date from the document status,
if at all possible.   Also put in a new flag `-f`, which forces
a write to the file by the simple expedient of removing the
old one before running.
2008-01-15 13:48:04 -08:00
david parsons d46b726bb3 1. Add the new flag MKD_BROKET, which tells markdown to expand all text <>s.
2. define the flag `MKD_EMBED`, which turns on `<>` and `"`expansion.
3. modify `theme` so it keeps track of whether it's inside html tags and
   whether it's in the header or body of a page.
2008-01-15 08:40:43 -08:00
david parsons 8a2ef658d5 Tweaks to the output of <?theme author?> and <?theme version?> 2008-01-15 01:06:18 -08:00
david parsons 65cfdff3e8 Add a markdown'ed version of theme (totally new code with many less
features!)
2008-01-15 00:59:40 -08:00
david parsons 75d8583dd6 The -V options that markdown prints are now a part of the version[] number.
version.c.in is version.c ready to be preprocessed to include a constant
TABSTOP string (the ansi cpp may be able to convert an integer into a string
with `#`, but gcc does not properly implement the ansi preprocessor, so we've
gotta use sed instead.)
2008-01-14 23:16:02 -08:00
david parsons d034d81a4c Add in another horrible kludge to get markdown to pass the official
test suite.  It turns out that _paragraphs act differently_ depending
on whether they're at the top level or not.  If it's a toplevel paragraph,
it absorbs adjacent list items, otherwise it breaks them into a list block.
2008-01-11 16:58:42 -08:00
david parsons 9e6fc14c93 1. Modify code() so that it will eat single blank characters at the start
and end of a code run.  (fixes "(\`\` \` \`\`)" defect)
2. trim spaces at the end of the first line in any block. (fixes
   a defect where the reference trims spaces at the start of a code
   block, but I didn't.)
2008-01-10 22:07:13 -08:00
david parsons 1337ed9d77 Document the format of the version string; describe the -F option 2008-01-10 16:17:47 -08:00
david parsons 38640dc511 Pass flags in to mkd_in() and mkd_string(), protect against user flags 2008-01-10 16:02:30 -08:00
david parsons 19db8db1c0 Take out the (#if 0'ed) code to expand > to &gt; in text().
Correct the mislabeled MKD_NOPANTS reference in markdown.3
2008-01-10 15:02:16 -08:00
david parsons 3fc49328f3 Rework the published interface.
1. Officially expose mkd_compile(), mkd_cleanup(),
       mkd_generatehtml().
    2. Internally use the new Document structure, which
       hold the markup and (optionally) header information.
    3. Support ``--enable-<foo>`` during configure.sh
       * change --with-dl-tag to --enable-dl-tag.
       * add --enable-pandoc-header to support pandoc headers.
2008-01-10 12:22:39 -08:00
david parsons bdf9e535f7 Linkylinky() went out of control, so it's been dissolved into a family of linky functions.
bookmark tags are now stored without the framing [] and a trailing 0;
the bookmark compare function compares S(a->tag) and S(b->tag) before
doing the strncasecmp() on T(a->tag) and T(b->tag)
2008-01-09 23:58:51 -08:00
david parsons 402c0ea525 Edits to make markdown pass John Gruder's test suite. 2008-01-09 17:36:55 -08:00
david parsons 2c3379ed7f Quoted blocks are bizarre.
You can start a quoted block by doing
>blah

but once you're inside the block markdown assumes the
prefix is '> ', so you need a *5* space indent from
the '>' to introduce a code block.
2008-01-09 11:30:51 -08:00
david parsons f3e4e2c821 Add a testcase for codeblocks 2008-01-09 10:55:46 -08:00
david parsons 25015c028b 0.8.1: don't do a newline after <pre><code> 2008-01-09 10:53:14 -08:00
david parsons 2ac737368d Protect input streams with a null suffix (pull() properly returns
EOF at end of stream, but if I use do a sscanf(cursor(), ...), it
will cheerfully run off the end of the stream and into core dump
city unless I put a guard there.
2007-12-22 23:03:01 -08:00
david parsons 22f53ba4ea Write the manpage for the markdown functions, modify the makefile so
all of the manpages are correctly installed.
2007-12-22 00:56:10 -08:00
david parsons a5ec76b7fb Make markdown() reentrant by stuffing all the state information into a MMIOT. 2007-12-21 23:56:56 -08:00
david parsons 3def455368 Forgot to close the tag for the img linkylinky 2007-12-21 14:54:51 -08:00
david parsons 467d4a0cbf Version 0.3: publish push [->mkd_push] and text [->mkd_text] 2007-12-21 13:37:41 -08:00