This involves reworking the blocktag[] array into a STRING(), and moving the entire
kit and kaboodle out into a separate file with a public initializer (mkd_prepare_tags),
definer (mkd_define_tag) sort (mkd_sort_tags, and lookup (mkd_search_tags) function.
The html5 tags are further removed into their own function (mkd_with_html5_tags) which
can be included when someone wishes to have html5 support.
Note that html5 support is library-wide; once you call mkd_with_html5_tags, you're
stuck with them everywhere and can't back them out. This might be revisited later,
the clipping depth for the contents of a list block needs to
be at least 2 (1 for the list marker, one for the mandatory
space) plus I only care about not counting setext headers
(a line of text, followed by a line of dashes) as list items.
This is probably not the final form of this patch; I should
redo it with a STRING() array to hold the tags and have a
with_html5() function that adds the html5 tags to the array.
(Or something like that.)
>[...] changes to the APE environment had broken Discount builds
>there. The compiler is being choosy in a new way about *snprintf,
>and no longer liked Csio.c:29.
>
>Working around this takes a one-line edit in Plan9/mkfile, as shown
>in the attached patch, and results in a clean build, passes tests,
>etc.
>
>Long form explanation from the APE docs, for curiosity's sake:
>
>>_C99_SNPRINTF_EXTENSION
>>This extension permits the use of the return values of .I snprintf
>>and .I vsnprintf . Before C99, the 1999 C standard, these functions
>>usually returned the number of bytes, excluding terminating NUL,
>>actually stored in the target string. (GNU, as usual, had to be
>>different and returned -1 if the target string was too small.) C99
>>requires them to instead return the number of bytes, excluding
>>terminating NUL, that would have been written into the target string
>>if it were infinitely large or a negative value if an `encoding
>>error' occurs, so old programs compiled under C99 rules will be
>>prone to overrunning their buffers. This extension is a way for the
>>programmer to declare that he or she understands the situation and
>>has adjusted the code being compiled to compensate.
declarations.
2. redo, again, the internals of codeblock() [renamed back to
code()], codespan(), and printcode() so that code() simply
prints out code (with `<` & `&` properly expanded, but nothing
else) and codespan() & printcode() simply call it after doing
whatever trimming and framing they want to do.
that prints the `<img src="link"` and `<a href="link"`)
out into its own subroutine so I don't have to duplicate
the mass of code that handles callback and the url base
prefixes.
Add 1 feature; allow the user to specify only the width
or height of an image by the simple expedient of leaving
a number off the =WxH parameter.
Fix 2 table bugs: first, don't treat a single line with
pipes as a table, and secondly don't silently delete
tables that are just the header lines.
construct like `<foo [bar](foo) <s>hi</s>` will result in everything
between the first < and the next > being passed through untouched.
It's pretty gross, but It's The Standard(tm).
to deal with the stupid FSF compiler, which has ArCaNe KnOwLeDgE about bzero
and memset and will fall over and die if you don't provide arguments for
the functions even if you don't #include <string.h> (or whatever include
file has the prototype)
caused `splat()` to end up picking up uninitialized
data from the `align` string, which resulted in core
dumps when that data was used to figure out which
alignment to use.
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.
that when processing Lines in compile_document().
2. Add some test cases for [footnote] links showing up in
random places.
3. In `dumptree()`, show the `ident` string ,if any, associated
with a given block.
`compile()` out into `compile_document()` (toplevel; split documents
into html, style, sourcecode, extracts all footnotes) and `compile()`
(compiles all content, but does not process html blocks or footnotes)
Not perfect: I should not need the SOURCE object type -- I should be
able to simple compile a block of source and append that source onto
the top-level paragraph list, but when I do that I end up with memory
leaks and test failures.
2. Tweak the paragraph wrapping in `generate()` so that all
paragraphs in a multiple-paragraph item/blockquote will
be properly wrapped with `<p>`...`</p>` (or whatever is
appropriate.)
3. Attempt to follow indentation better inside lists, so
a list item with multiple paragraphs is parsed correctly
when the second (& up) paragraphs are indented the same
as the first paragraph.
trigger on c & 0xC0, then loop on utf-8 stanzas until we hit
something else, but keep track of width and stop printing if
we run out of space in the middle of a string of > U+007F
characters.