diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-01-07 11:17:24 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-01-07 11:23:29 -0800 |
commit | 52c591d75433b16cf32f4fae319ccb60b20f6ae7 (patch) | |
tree | af0e956b72dfbc3883252f48d3f2138b55aca367 /src/cmark.h | |
parent | a29c16c5e283fb50ecd318477072687caf987d4a (diff) |
cmark: Add function & option to normalize text 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.
Diffstat (limited to 'src/cmark.h')
-rw-r--r-- | src/cmark.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cmark.h b/src/cmark.h index 2051a04..45bc338 100644 --- a/src/cmark.h +++ b/src/cmark.h @@ -356,6 +356,11 @@ cmark_node_prepend_child(cmark_node *node, cmark_node *child); CMARK_EXPORT int cmark_node_append_child(cmark_node *node, cmark_node *child); +/** Consolidates adjacent text nodes. + */ +CMARK_EXPORT void +cmark_consolidate_text_nodes(cmark_node *root); + /** * ## Parsing * @@ -441,6 +446,10 @@ char *cmark_render_man(cmark_node *root, long options); */ #define CMARK_OPT_HARDBREAKS 2 +/** Normalize tree by consolidating adjacent text nodes. + */ +#define CMARK_OPT_NORMALIZE 4 + /** # AUTHORS * * John MacFarlane, Vicent Marti, Kārlis Gaņģis, Nick Wellnhofer. |