diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-06-29 15:38:09 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-06-29 15:38:09 +0000 |
commit | e8ac047d456be99aa702c302ba49dce872afd4fe (patch) | |
tree | e7f6b7c8555b193529ca5ccc9947eaa867eeb3f3 | |
parent | a0711566e81ba5fc0028c367fb6c9b3a6e2ba22d (diff) | |
download | mandoc-e8ac047d456be99aa702c302ba49dce872afd4fe.tar.gz |
First fix how `sp 1' doesn't imply `1v' (it now does) and that 1
followed by non-digits, e.g. `1g', really means `1'. Next, fix some
spacing issues where `sp' was invoked in -man after sections or
subsections. Make sure this behaviour is mirrored in -Thtml.
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | man_html.c | 5 | ||||
-rw-r--r-- | man_term.c | 9 | ||||
-rw-r--r-- | mdoc_html.c | 5 | ||||
-rw-r--r-- | mdoc_term.c | 3 |
5 files changed, 16 insertions, 8 deletions
@@ -306,8 +306,6 @@ should produce one, not three blank lines. Reported by naddy@ Mon, 28 Mar 2011 20:45:42 +0200 -- At least sometimes, .sp is ignored right after .SH; see named.conf(5). - - trailing whitespace must be ignored even when followed by a font escape, see for example makes @@ -414,8 +414,9 @@ man_br_pre(MAN_ARGS) SCALE_VS_INIT(&su, 1); if (MAN_sp == n->tok) { - if (n->child) - a2roffsu(n->child->string, &su, SCALE_VS); + if (NULL != (n = n->child)) + if ( ! a2roffsu(n->string, &su, SCALE_VS)) + SCALE_VS_INIT(&su, atoi(n->string)); } else su.scale = 0; @@ -181,7 +181,7 @@ a2height(const struct termp *p, const char *cp) struct roffsu su; if ( ! a2roffsu(cp, &su, SCALE_VS)) - SCALE_VS_INIT(&su, term_strlen(p, cp)); + SCALE_VS_INIT(&su, atoi(cp)); return(term_vspan(p, &su)); } @@ -411,6 +411,13 @@ pre_sp(DECL_ARGS) { size_t i, len; + if ((NULL == n->prev && n->parent)) { + if (MAN_SS == n->parent->tok) + return(0); + if (MAN_SH == n->parent->tok) + return(0); + } + switch (n->tok) { case (MAN_br): len = 0; diff --git a/mdoc_html.c b/mdoc_html.c index 62c865cb..d7906a6c 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1633,8 +1633,9 @@ mdoc_sp_pre(MDOC_ARGS) SCALE_VS_INIT(&su, 1); if (MDOC_sp == n->tok) { - if (n->child) - a2roffsu(n->child->string, &su, SCALE_VS); + if (NULL != (n = n->child)) + if ( ! a2roffsu(n->string, &su, SCALE_VS)) + SCALE_VS_INIT(&su, atoi(n->string)); } else su.scale = 0; diff --git a/mdoc_term.c b/mdoc_term.c index bf2997fa..943cc8b0 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -523,9 +523,10 @@ a2height(const struct termp *p, const char *v) { struct roffsu su; + assert(v); if ( ! a2roffsu(v, &su, SCALE_VS)) - SCALE_VS_INIT(&su, term_len(p, 1)); + SCALE_VS_INIT(&su, atoi(v)); return(term_vspan(p, &su)); } |