Commit Graph
27 Commits
Author SHA1 Message Date
david parsons 6fbfeb9116 fix a handful of places where I either didn't guard against underflows or null pointers; add test cases for them in crash.t 2023-12-11 19:42:37 -08:00
david parsons 0571211c84 I wasn't properly uniqifying the top level of compiled fragments for toc labels 2022-03-28 10:18:11 -07:00
david parsons 304344cf1f I was a little too aggressive when stripping out the recursive uniquification (& redo the test case to reflect starting sequences at zero instead of 1 2022-03-23 16:10:58 -07:00
david parsons 343845b66d rework the whole TOC uniquifier so it only runs at the end of a compilation; put code in (#ifdeffed out) to recursively uniquify names if I ever decide to throw a wider net when generating a TOC 2022-03-23 16:08:07 -07:00
david parsons 599617843e implement a toc label uniquifier 2022-03-22 17:01:14 -07:00
Tim Gates c111310687 docs: fix simple typo, inport -> import
There is a small typo in toc.c.

Should read `import` rather than `inport`.
2020-12-16 05:46:53 +11:00
david parsons 1003923bca fix a malloc overflow when doing mkd_anchor_format() 2020-03-28 23:14:23 -07:00
david parsons b9e867b574 redo the whole flags dealie as an opaque blob 2019-12-07 22:49:52 -08:00
david parsons 0d33c8fe0d tweak how scalar headers are include in .in files 2019-02-27 12:10:35 -08:00
david parsons 1f90fde27f add an anchor format callback, plus add the -x option to the markdown program to squash toc anchors to (close to) github compatability 2019-02-18 20:54:05 -08:00
david parsons 0308244ec8 shuffle around some of the definitions to make everything happily(?) compile with all instances of flags being mkd_flag_t 2018-09-18 08:32:03 -07:00
david parsons a12d7d7294 take a pass at github checklist items 2018-04-17 18:09:33 -07:00
david parsons 9d0de94005 In mkd_toc(), take the hijack-the-T() hack out and strdup() the generated toc
into the target pointer.
2017-01-21 23:57:11 -08:00
david parsons 07c8114da9 call Csreparse with IS_LABEL set, so that embedded html will be stripped out 2016-12-31 19:37:38 -08:00
david parsons 72c99f10b2 When generating a TOC, don't anchor-encode the human-readable contents of the links . 2016-12-31 18:18:32 -08:00
Nathan Phillip Brink 5da3388382 Convert urlencodedanchor to a runtime flag for issue #124.
Instead of `./configure.sh --with-urlencoded-anchor`, now use
`-furlencodedanchor` or `MKD_URLENCODEDANCHOR`.
2015-07-13 03:24:31 +00:00
david parsons 96338942d1 Changes contributed by Stefano D'Angelo to clean up the toc html 2011-11-23 18:26:23 -08:00
david parsons 2b6ea3799e create a typedef for the function argument to mkd_string_to_anchor, because some
compilers (and by some compilers, I mean "gcc") whine bitterly when you pass a
function argument with with a more specific pointer in place of a void*.   And if
I can't trust the compiler to emit sensible warnings, I'll just cast the damned
argument to a type that makes it stfu.

In addition, I needed to add prototypes for the html5 tag adder and the two
functions that spit out a list of the flags that the code was compiled with.
2011-01-29 11:00:54 -08:00
david parsons e8d67af6c7 More work on making mkd_css() and mkd_toc() resemble each other. 2011-01-04 21:27:52 -08:00
david parsons 7fb50d3563 Tweak the way I null-pad and return values from mkd_css() and mkd_toc() 2011-01-04 11:59:54 -08:00
david parsons 249d38fca5 Null-terminate the strings generated by mkd_css() and mkd_toc().
This reduces any surprises that happen when someone uses these functions
but doesn't check the return value.
2011-01-01 21:38:32 -08:00
david parsons 12bb2b959b Convert all the internal flag bit names so they are the
same as the public flag bit names.
2010-10-22 12:59:06 -07:00
David Parsons 0b39f0c30a First pass at discount version 2: convert flags into a 32 bit quantity,
make superscript and relaxed emphasis into flag bits instead of compile
switches.
2010-10-21 21:03:17 -07:00
David Parsons 800e7f22a7 When I restructured the source tree after changing the footnote
code handler, I forgot to revisit the table of contents code, and
this made it break.  I also added a test case to check that the
table of contents is actually being generated.
2009-09-11 09:17:04 -07:00
david parsons 142e1155bd Tweak function names (__mkd_reparse -> ___mkd_reparse and
`__mkd_emblock` -> `___mkd_emblock`), add prototypes in `markdown.h`,
change `Csputc()` from an int to a void function, make `Csreparse()`
a void function.
2009-02-28 09:54:42 -08:00
David Parsons 9397c0a5c7 Redo toc.c to add the new function mkd_toc(), which writes the
generate toc to a string.   Documented in `markdown.3`
and `mkd-functions.3`, requires a new file (`Csio.c`) that has
functions for writing to a Cstring, requires that some of the
internal functions in `generate.c` be exposed (and renaed to
`__mkd_`*function* to reduce namespace collisions.

The new functions in Csio (particularly `Csprintf()` should make
it easier to convert many of the other "we print to a `FILE*` and
you need to lump it" functions into a pair of "print to a string"
and "print to a file" functions.
2009-02-27 16:47:02 -08:00
David Parsons efcda8faf3 Forgot to check in toc.c 2008-09-26 22:08:30 -07:00