summaryrefslogtreecommitdiffstats
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-06 10:50:56 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-06 10:50:56 +0000
commitcbb95644f4f29dc2eeced60e1e0eb4e078df2d8d (patch)
treeb5a8c2cb5086223f7cdc841c023e583f8d0f19fe /mdoc_html.c
parent18ce0cffef9ab74b714f5947c121b18b6e7a146f (diff)
downloadmandoc-cbb95644f4f29dc2eeced60e1e0eb4e078df2d8d.tar.gz
Fixed -Tascii and -Thtml rendering of `Ft' and `Fo'.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 21395f0e..b2d075e4 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1247,7 +1247,7 @@ mdoc_d1_pre(MDOC_ARGS)
/* FIXME: D1 shouldn't be literal. */
- SCALE_VS_INIT(&su, INDENT - 1);
+ SCALE_VS_INIT(&su, INDENT - 2);
bufcat_su(h, "margin-left", &su);
PAIR_CLASS_INIT(&tag[0], "lit");
PAIR_STYLE_INIT(&tag[1], h);
@@ -1563,8 +1563,8 @@ mdoc_ft_pre(MDOC_ARGS)
{
struct htmlpair tag;
- if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags)
- print_otag(h, TAG_DIV, 0, NULL);
+ if (SEC_SYNOPSIS == n->sec && n->prev)
+ print_otag(h, TAG_BR, 0, NULL);
PAIR_CLASS_INIT(&tag, "ftype");
print_otag(h, TAG_SPAN, 1, &tag);
@@ -1594,10 +1594,6 @@ mdoc_fn_pre(MDOC_ARGS)
SCALE_VS_INIT(&su, 1);
bufcat_su(h, "margin-top", &su);
}
- if (n->next) {
- SCALE_VS_INIT(&su, 1);
- bufcat_su(h, "margin-bottom", &su);
- }
PAIR_STYLE_INIT(&tag[0], h);
print_otag(h, TAG_DIV, 1, tag);
}
@@ -1785,25 +1781,39 @@ mdoc_mt_pre(MDOC_ARGS)
static int
mdoc_fo_pre(MDOC_ARGS)
{
- struct htmlpair tag;
- struct roffsu su;
+ struct htmlpair tag;
+ struct roffsu su;
+ struct tag *t;
if (MDOC_BODY == n->type) {
h->flags |= HTML_NOSPACE;
print_text(h, "(");
h->flags |= HTML_NOSPACE;
return(1);
- } else if (MDOC_BLOCK == n->type && n->next) {
+ } else if (MDOC_BLOCK == n->type) {
+ if (SEC_SYNOPSIS != n->sec)
+ return(1);
+ if (NULL == n->prev || MDOC_Ft == n->prev->tok) {
+ print_otag(h, TAG_DIV, 0, NULL);
+ return(1);
+ }
SCALE_VS_INIT(&su, 1);
- bufcat_su(h, "margin-bottom", &su);
+ bufcat_su(h, "margin-top", &su);
PAIR_STYLE_INIT(&tag, h);
print_otag(h, TAG_DIV, 1, &tag);
return(1);
}
+ /* XXX: we drop non-initial arguments as per groff. */
+
+ assert(n->child);
+ assert(n->child->string);
+
PAIR_CLASS_INIT(&tag, "fname");
- print_otag(h, TAG_SPAN, 1, &tag);
- return(1);
+ t = print_otag(h, TAG_SPAN, 1, &tag);
+ print_text(h, n->child->string);
+ print_tagq(h, t);
+ return(0);
}