aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-06-29 15:38:09 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-06-29 15:38:09 +0000
commit2f53f5a989471121a5bf1f4a5c4d4a335b0f7fdb (patch)
tree3af6bd3a47d59ceeeec7573b2c6a92212f8db887
parent9a1658910c9c2fa6e8b2d75172f98c96f3c99ba2 (diff)
downloadmandoc-2f53f5a989471121a5bf1f4a5c4d4a335b0f7fdb.tar.gz
mandoc-2f53f5a989471121a5bf1f4a5c4d4a335b0f7fdb.tar.zst
mandoc-2f53f5a989471121a5bf1f4a5c4d4a335b0f7fdb.zip
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--TODO4
-rw-r--r--man_html.c7
-rw-r--r--man_term.c11
-rw-r--r--mdoc_html.c7
-rw-r--r--mdoc_term.c5
5 files changed, 21 insertions, 13 deletions
diff --git a/TODO b/TODO
index 6cd2adf0..69d0d38c 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,6 @@
************************************************************************
* Official mandoc TODO.
-* $Id: TODO,v 1.113 2011/06/18 17:58:48 kristaps Exp $
+* $Id: TODO,v 1.114 2011/06/29 15:38:09 kristaps Exp $
************************************************************************
************************************************************************
@@ -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
diff --git a/man_html.c b/man_html.c
index 393209f1..f3aab2e2 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.74 2011/06/18 20:34:08 kristaps Exp $ */
+/* $Id: man_html.c,v 1.75 2011/06/29 15:38:09 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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;
diff --git a/man_term.c b/man_term.c
index 8bf9d0c6..7bff3542 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.111 2011/06/18 17:58:48 kristaps Exp $ */
+/* $Id: man_term.c,v 1.112 2011/06/29 15:38:09 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -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 1db351ce..ae79e2a6 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.170 2011/06/16 22:21:28 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.171 2011/06/29 15:38:09 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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 1a5ce4c2..a1477546 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.230 2011/05/17 14:38:34 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.231 2011/06/29 15:38:09 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -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));
}