Age | Commit message (Collapse) | Author |
|
Introduce multi-purpose data/len members in struct cmark_node. This
is mainly used to store literal text for inlines, code and HTML blocks.
Move the content strbuf for blocks from cmark_node to cmark_parser.
When finalizing nodes that allow inlines (paragraphs and headings),
detach the strbuf and store the block content in the node's data/len
members. Free the block content after processing inlines.
Reduces size of struct cmark_node by 8 bytes.
|
|
Use zero-terminated C strings and a separate length field instead of
cmark_chunks. Literal inline text will now be copied from the parent
block's content buffer, slowing the benchmark down by 10-15%.
The node struct never references memory of other nodes now, fixing #309.
Node accessors don't have to check for delayed creation of C strings,
so parsing and iterating all literals using the public API should
actually be faster than before.
|
|
|
|
|
|
|
|
|
|
API change. Sorry, but this is the time to break things,
before 1.0 is released. This matches the recent changes to
CommonMark.dtd.
|
|
CMARK_NODE_HRULE -> CMARK_NODE_THEMATIC_BREAK.
However we've defined the former as the latter to keep
backwards compatibility.
See jgm/CommonMark 8fa94cb460f5e516b0e57adca33f50a669d51f6c
|
|
|
|
* Reformatted all source files.
* Added 'format' target to Makefile.
* Removed 'astyle' target.
* Updated .editorconfig.
|
|
|
|
This improves on #32, I think.
@elibarzilay, does this look better? We now avoid the allocations
associated with cmark_get_literal, and copy directly from
the chunk to the buffer.
|
|
This avoids allocating a new string.
Closes #32.
|
|
|
|
This bug was introduced after the modification in
009c3847f004fda437dd5376a9452973b1cb913e.
|
|
|
|
|
|
* Advance to the next node when calling 'cmark_iter_next', not when
calling 'cmark_iter_get_node'.
* Add 'cmark_iter_get_event_type' accessor.
* Allow deletion of nodes after an 'EXIT' event, or an 'ENTER' event for
leaf nodes.
|
|
|
|
|
|
|
|
So, instead of
<text>Hi</text>
<text>&</text>
<text>lo</text>
we get
<text>Hi&lo</text>
* Added exported `cmark_consolidate_text_nodes` function.
* Added `CMARK_OPT_NORMALIZE` to options.
* Added optional normalization in XML writer.
* Added `--normalize` option to command-line program.
* Updated man page.
|
|
|
|
* Added `iterator.c`, `iterator.h`.
* Removed `cmark_walk`.
* Replaced `cmark_walk` with iterator in HTML renderer.
* Replaced API test for `cmark_walk` with simple iterator test.
|