From 9c3a7023014f961197bc27ff8360ce9e1b1d6c29 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 9 Apr 2016 11:44:58 -0700 Subject: Fixed a number of issues relating to line wrapping. - Extend CMARK_OPT_NOBREAKS to all renderers and add `--nobreaks`. - Do not autowrap, regardless of width parameter, if CMARK_OPT_NOBREAKS is set. - Fixed CMARK_OPT_HARDBREAKS for LaTeX and man renderers. - Ensure that no auto-wrapping occurs if CMARK_OPT_NOBREAKS is enabled, or if output is CommonMark and CMARK_OPT_HARDBREAKS is enabled. - Updated man pages. --- src/main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index fa18e03..5716e18 100644 --- a/src/main.c +++ b/src/main.c @@ -27,6 +27,7 @@ void print_usage() { printf(" --width WIDTH Specify wrap width (default 0 = nowrap)\n"); printf(" --sourcepos Include source position attribute\n"); printf(" --hardbreaks Treat newlines as hard line breaks\n"); + printf(" --nobreaks Render soft line breaks as spaces\n"); printf(" --safe Suppress raw HTML and dangerous URLs\n"); printf(" --smart Use smart punctuation\n"); printf(" --normalize Consolidate adjacent text nodes\n"); @@ -90,6 +91,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], "--nobreaks") == 0) { + options |= CMARK_OPT_NOBREAKS; } else if (strcmp(argv[i], "--smart") == 0) { options |= CMARK_OPT_SMART; } else if (strcmp(argv[i], "--safe") == 0) { -- cgit v1.2.3