diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-07-18 11:09:31 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-07-18 11:09:31 +0000 |
commit | f0649356f08ec54bfa01c6ab733db8d7e0d04e42 (patch) | |
tree | 4a292fcca0b81b1732f41387e6413b7550b55338 /usr.bin/mandoc/mdoc.c | |
parent | 60dd10dead840994ee21087a8fcdcf92aa139c64 (diff) |
Fix handling of paragraph macros inside lists:
* When they are trailing the last item, move them outside the list.
* When they are trailing any other none-compact item, drop them.
Improves formatting of 40 pages, e.g. grep(1), ksh(1), netstat(1),
ath(4), bsd.port.mk(5), pf.conf(5), mount(8), crypto(9).
Diffstat (limited to 'usr.bin/mandoc/mdoc.c')
-rw-r--r-- | usr.bin/mandoc/mdoc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c index ca5b09b2550..9ffc5dab783 100644 --- a/usr.bin/mandoc/mdoc.c +++ b/usr.bin/mandoc/mdoc.c @@ -1,7 +1,7 @@ -/* $Id: mdoc.c,v 1.90 2012/07/18 10:36:20 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.91 2012/07/18 11:09:30 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> - * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> + * Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -644,6 +644,14 @@ mdoc_node_delete(struct mdoc *m, struct mdoc_node *p) mdoc_node_free(p); } +int +mdoc_node_relink(struct mdoc *m, struct mdoc_node *p) +{ + + mdoc_node_unlink(m, p); + return(node_append(m, p)); +} + #if 0 /* * Pre-treat a text line. |