From: Alan Cox Date: Sat, 24 Sep 2016 13:18:09 +0000 (+0100) Subject: marksman: allow the use of \ on line ends for 'newline' suppression X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=32676226fe0208da130bf308e43e966b5820c664;p=FUZIX.git marksman: allow the use of \ on line ends for 'newline' suppression --- diff --git a/Applications/util/marksman.c b/Applications/util/marksman.c index 4114eb41..0a0745f5 100644 --- a/Applications/util/marksman.c +++ b/Applications/util/marksman.c @@ -60,7 +60,8 @@ static uint8_t format[4]; /* Format flags */ static uint8_t bold_forced; /* Force text bold */ static uint8_t indent; static uint8_t listindent; /* List indenting */ -uint16_t olist_count; +static uint16_t olist_count; +static uint8_t suppressnl; /* Next newline shouldn't happen */ static uint8_t tcols; /* Table columns */ static uint8_t trow; /* Table row count */ @@ -147,8 +148,9 @@ static void force_newline(void) static void newline(void) { wordflush(); - if (xpos) + if (xpos && !suppressnl) force_newline(); + suppressnl = 0; } /* FIXME: Replace these with termcap handlers */ @@ -385,6 +387,11 @@ static void normal_syntax(char *p) t = NULL; if (p[1]) p++; + else { + /* End of line is \ - supress a newline */ + suppressnl = 1; + break; + } } /* We've found markdown */