]> git.cameronkatri.com Git - mandoc.git/blobdiff - mdoc_macro.c
Do not prematurely close .Nd containing a broken child.
[mandoc.git] / mdoc_macro.c
index 3326add65b82d4d890047433e9a108d8c32d9b73..a1cea0ef3c030302a176362d7e28bcc22846a089 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: mdoc_macro.c,v 1.213 2017/02/11 13:24:12 schwarze Exp $ */
+/*     $Id: mdoc_macro.c,v 1.214 2017/02/11 14:11:17 schwarze Exp $ */
 /*
  * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010, 2012-2016 Ingo Schwarze <schwarze@openbsd.org>
@@ -647,10 +647,16 @@ blk_exp_close(MACRO_PROT_ARGS)
                        break;
                }
 
-               /* Explicit blocks close out description lines. */
+               /*
+                * Explicit blocks close out description lines, but
+                * even those can get broken together with a child.
+                */
 
                if (n->tok == MDOC_Nd) {
-                       rew_last(mdoc, n);
+                       if (later != NULL)
+                               n->flags |= NODE_BROKEN | NODE_ENDED;
+                       else
+                               rew_last(mdoc, n);
                        continue;
                }