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/xml.c | |
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/xml.c')
-rw-r--r-- | src/xml.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -123,6 +123,11 @@ char *cmark_render_xml(cmark_node *root, long options) cmark_event_type ev_type; cmark_node *cur; struct render_state state = { &xml, 0 }; + + if (options & CMARK_OPT_NORMALIZE) { + cmark_consolidate_text_nodes(root); + } + cmark_iter *iter = cmark_iter_new(root); cmark_strbuf_puts(state.xml, |