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.
master
Drew DeVault 6 years ago
parent 2822228873
commit 1c03e57750
  1. 9
      src/main.c

@ -578,6 +578,15 @@ static void parse_document(struct parser *p) {
parser_fatal(p, "Tabs are required for indentation"); parser_fatal(p, "Tabs are required for indentation");
break; break;
case '\n': 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); roff_macro(p, "P", NULL);
break; break;
default: default:

Loading…
Cancel
Save