diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-12-15 23:39:40 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-12-15 23:39:40 +0000 |
commit | c4788e9b021a0c7106d8aeb617d236222ebe19b6 (patch) | |
tree | 079a228cbab677524c865c3412275b27be4d17c1 /mdoc_macro.c | |
parent | 170e9dcf90a5e92a66337dd469337bb728efe516 (diff) | |
download | mandoc-c4788e9b021a0c7106d8aeb617d236222ebe19b6.tar.gz |
Add a "last child" member of struct mdoc_node.
Remove `Pp' or `Lp' if it is the FIRST or LAST child of an `Sh' or `Sh' body.
Make "skipping paragraph" be an error, not a warning, as information (an
invoked macro) is ignored.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r-- | mdoc_macro.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c index 34037b2c..79cededd 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -252,6 +252,7 @@ lookup_raw(const char *p) static int rew_last(struct mdoc *mdoc, const struct mdoc_node *to) { + struct mdoc_node *n; assert(to); mdoc->next = MDOC_NEXT_SIBLING; @@ -260,8 +261,10 @@ rew_last(struct mdoc *mdoc, const struct mdoc_node *to) while (mdoc->last != to) { if ( ! mdoc_valid_post(mdoc)) return(0); + n = mdoc->last; mdoc->last = mdoc->last->parent; assert(mdoc->last); + mdoc->last->last = n; } return(mdoc_valid_post(mdoc)); |