* mdocml: First fix how `sp 1' doesn't imply `1v' (it now does) and that 1
@ 2011-06-29 15:38 kristaps
0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-06-29 15:38 UTC (permalink / raw)
To: source
Log Message:
-----------
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.
Modified Files:
--------------
mdocml:
TODO
man_html.c
man_term.c
mdoc_html.c
mdoc_term.c
Revision Data
-------------
Index: man_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_term.c,v
retrieving revision 1.111
retrieving revision 1.112
diff -Lman_term.c -Lman_term.c -u -p -r1.111 -r1.112
--- man_term.c
+++ man_term.c
@@ -181,7 +181,7 @@ a2height(const struct termp *p, const ch
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));
}
@@ -410,6 +410,13 @@ static int
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):
Index: man_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_html.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -Lman_html.c -Lman_html.c -u -p -r1.74 -r1.75
--- man_html.c
+++ man_html.c
@@ -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;
Index: TODO
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/TODO,v
retrieving revision 1.113
retrieving revision 1.114
diff -LTODO -LTODO -u -p -r1.113 -r1.114
--- TODO
+++ TODO
@@ -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
Index: mdoc_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v
retrieving revision 1.170
retrieving revision 1.171
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.170 -r1.171
--- mdoc_html.c
+++ 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;
Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.230
retrieving revision 1.231
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.230 -r1.231
--- mdoc_term.c
+++ mdoc_term.c
@@ -523,9 +523,10 @@ a2height(const struct termp *p, const ch
{
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));
}
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-06-29 15:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-29 15:38 mdocml: First fix how `sp 1' doesn't imply `1v' (it now does) and that 1 kristaps
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).