From 52c591d75433b16cf32f4fae319ccb60b20f6ae7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 7 Jan 2015 11:17:24 -0800 Subject: cmark: Add function & option to normalize text nodes. So, instead of Hi & lo we get Hi&lo * 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. --- src/xml.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/xml.c') diff --git a/src/xml.c b/src/xml.c index 2ae900c..93a6eda 100644 --- a/src/xml.c +++ b/src/xml.c @@ -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, -- cgit v1.2.3