summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--mdoc.c16
-rw-r--r--mdoc_validate.c7
2 files changed, 17 insertions, 6 deletions
diff --git a/mdoc.c b/mdoc.c
index d3d897cf..7e1d0f4b 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.118 2010/03/31 07:42:04 kristaps Exp $ */
+/* $Id: mdoc.c,v 1.119 2010/04/03 13:02:35 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -600,8 +600,18 @@ parsetext(struct mdoc *m, int line, char *buf)
for (i = 0; ' ' == buf[i]; i++)
/* Skip leading whitespace. */ ;
- if ('\0' == buf[i])
- return(mdoc_perr(m, line, 0, ENOBLANK));
+ if ('\0' == buf[i]) {
+ if ( ! mdoc_pwarn(m, line, 0, ENOBLANK))
+ return(0);
+ /*
+ * Assume that a `Pp' should be inserted in the case of
+ * a blank line. Technically, blank lines aren't
+ * allowed, but enough manuals assume this behaviour
+ * that we want to work around it.
+ */
+ if ( ! mdoc_elem_alloc(m, line, 0, MDOC_Pp, NULL))
+ return(0);
+ }
/*
* Break apart a free-form line into tokens. Spaces are
diff --git a/mdoc_validate.c b/mdoc_validate.c
index b9c2fc25..e83b4c2b 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.59 2010/03/31 07:13:53 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.60 2010/04/03 13:02:35 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1308,8 +1308,9 @@ post_sh_head(POST_ARGS)
* non-CUSTOM has a conventional order to be followed.
*/
- if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed)
- return(mdoc_nerr(mdoc, mdoc->last, ESECNAME));
+ if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed &&
+ ! mdoc_nwarn(mdoc, mdoc->last, ESECNAME))
+ return(0);
if (SEC_CUSTOM == sec)
return(1);
if (sec == mdoc->lastnamed)