commit 1c03e5775018d991f4ca1e5e72ee2b40371d9da1
parent 28222288732d233b05d456e6f92561559f41696d
Author: Drew DeVault <sir@cmpwn.com>
Date: Sun, 7 Oct 2018 11:25:43 -0400
Error if formatting continues to next paragraph
This prevents the inevitable "nested formatting" error from being too
far away from the source of the issue.
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/main.c b/src/main.c
@@ -578,6 +578,15 @@ static void parse_document(struct parser *p) {
parser_fatal(p, "Tabs are required for indentation");
break;
case '\n':
+ if (p->flags) {
+ char error[512];
+ snprintf(error, sizeof(error), "Expected %c before starting "
+ "new paragraph (began with %c at %d:%d)",
+ p->flags == FORMAT_BOLD ? '*' : '_',
+ p->flags == FORMAT_BOLD ? '*' : '_',
+ p->fmt_line, p->fmt_col);
+ parser_fatal(p, error);
+ }
roff_macro(p, "P", NULL);
break;
default: