summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-01-07 11:17:24 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-07 11:23:29 -0800
commit52c591d75433b16cf32f4fae319ccb60b20f6ae7 (patch)
treeaf0e956b72dfbc3883252f48d3f2138b55aca367 /src/main.c
parenta29c16c5e283fb50ecd318477072687caf987d4a (diff)
cmark: Add function & option to normalize text nodes.
So, instead of <text>Hi</text> <text>&amp;</text> <text>lo</text> we get <text>Hi&amp;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/main.c')
-rw-r--r--src/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index eaef246..5855868 100644
--- a/src/main.c
+++ b/src/main.c
@@ -26,6 +26,7 @@ void print_usage()
printf(" --to, -t FORMAT Specify output format (html, xml, man)\n");
printf(" --sourcepos Include source position attribute\n");
printf(" --hardbreaks Treat newlines as hard line breaks\n");
+ printf(" --normalize Consolidate adjacent text nodes\n");
printf(" --help, -h Print usage information\n");
printf(" --version Print version\n");
}
@@ -79,6 +80,8 @@ int main(int argc, char *argv[])
options |= CMARK_OPT_SOURCEPOS;
} else if (strcmp(argv[i], "--hardbreaks") == 0) {
options |= CMARK_OPT_HARDBREAKS;
+ } else if (strcmp(argv[i], "--normalize") == 0) {
+ options |= CMARK_OPT_NORMALIZE;
} else if ((strcmp(argv[i], "--help") == 0) ||
(strcmp(argv[i], "-h") == 0)) {
print_usage();