]> git.cameronkatri.com Git - mandoc.git/blobdiff - man_macro.c
Mostly complete implementation of the 'c' (character available)
[mandoc.git] / man_macro.c
index c54f726e6dd3c06ae77936942d0906b36ca6e89b..ad63db9553af9fb80671e7f60088ad1ba7370f83 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: man_macro.c,v 1.129 2018/08/18 14:02:56 schwarze Exp $ */
+/*     $Id: man_macro.c,v 1.132 2018/08/18 20:41:54 schwarze Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2012-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -246,6 +246,12 @@ blk_close(MACRO_PROT_ARGS)
                mandoc_msg(MANDOCERR_BLK_NOTOPEN, man->parse,
                    line, ppos, roff_name[tok]);
                rew_scope(man, MAN_PP);
+               if (tok == MAN_RE) {
+                       roff_elem_alloc(man, line, ppos, ROFF_br);
+                       man->last->flags |= NODE_LINE |
+                           NODE_VALID | NODE_ENDED;
+                       man->next = ROFF_NEXT_SIBLING;
+               }
                return;
        }
 
@@ -262,6 +268,8 @@ blk_close(MACRO_PROT_ARGS)
        if (buf[*pos] != '\0') {
                roff_word_alloc(man, line, ppos, buf + *pos);
                man->last->flags |= NODE_DELIMC;
+               if (mandoc_eos(man->last->string, strlen(man->last->string)))
+                       man->last->flags |= NODE_EOS;
        }
 
        /* Move a trailing paragraph behind the block. */
@@ -286,7 +294,8 @@ blk_exp(MACRO_PROT_ARGS)
        char            *p;
        int              la;
 
-       rew_scope(man, tok);
+       if (tok == MAN_RS)
+               rew_scope(man, tok);
        roff_block_alloc(man, line, ppos, tok);
        head = roff_head_alloc(man, line, ppos, tok);