Age | Commit message (Collapse) | Author |
|
|
|
This controls column width for hard wrapping. By default it is
0, which means that no wrapping will be done.
Added a width parameter in `cmark_render_commonmark`.
|
|
This is still incomplete. (See TODOs in the source.)
|
|
|
|
|
|
|
|
Add new parser option argument.
|
|
This was a bug; the function does take an argument. Oddly, gcc and
clang did not complain.
Closes #12.
|
|
|
|
For consistency with the API.
|
|
Also to some non-exported functions in blocks and inlines.
|
|
So far this is only implemented for the HTML renderer.
Ultimately some of this should be factored out into a form that
can be used in other renderers.
|
|
Add a new template cmark_version.h.in to generate cmark_version.h
containing version information.
|
|
Add version number and string as macros and symbols. Version numbers can
be easily compared, for example in the C preprocessor:
#include <cmark.h>
#if CMARK_VERSION < 0x020200
#error Requires libcmark 2.2.0 or higher
#endif
Storing the version in a global variable allows to check the library
version at runtime. For example:
if (CMARK_VERSION != cmark_version) {
warn("Compiled against libcmark %s, but using %s",
CMARK_VERSION_STRING, cmark_version_string);
}
The version should be updated whenever the public API is changed.
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
To keep the API simple and avoid API changes when new options are
added, this is just a long integer.
Set it by disjoining options that are defined as powers of 2: e.g.
`CMARK_HTML_SOURCEPOS | CMARK_HTML_HARDREAKS`.
Test options using `&`: `if (options & CMARK_HTML_SOURCEPOS)`.
Added `--hardbreaks` and `--sourcepos` command-line options.
|
|
Even though this doesn't make a difference in default HTML
output, it's worth keeping track; some output formats may allow
you to distinguish lists with `1)` and with `1.` delimiters.
|
|
|
|
The xml representation of the AST is not quite as pretty, but
it contains the same information and is not in an ad hoc format.
See #53.
|
|
API exports cmark_node_get_column.
XML writer indicates start and end line and column for block-level
nodes.
|
|
|
|
And export in cmark.h public header.
Also, use lowercase names, not uppercase.
|
|
This is a work-in-progress.
CommonMark.dtd gives the DTD for the generated XML.
Closes #53.
|
|
|
|
|
|
|
|
|
|
`man/make_man_page.py` now converts using cmark.
|
|
cmark: Replaced `--man` and `--ast` with generic `--to` option.
|
|
* 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.
|
|
Added cmark_event_type enum, which is used as the second
parameter of the handler passed to cmark_walk.
See #224.
|
|
Modified finalize in blocks.c to return parent of finalized
block, so we can handle the case of reference definitions,
when we simply remove the finalized block.
|
|
This reverts commit b598b52a4acdc2332be3d34e30237d1b93b7dd03.
The change led to some problems, because some of the callers
of 'finalize' expected the node to exist after the call.
This could all be rewritten, but for now let's just revert.
|
|
|
|
There's no reason to store these empty nodes in the API.
The references have already been resolved.
|
|
|
|
This reverts commit 6c1f76a8a22f6c84231e5101f0950ce353ec8075.
|
|
|
|
This is more consistent with CMARK_LIST_NONE, etc.
|
|
This is the return value of cmark_get_node_type when the argument
is a null pointer. Avoids segfault.
|
|
|
|
|
|
|