diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-09-24 13:18:37 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-09-24 13:18:37 +0000 |
commit | 6a2359747f92ffc48b612b8fb8a2e7a87a9dff8f (patch) | |
tree | be91e0fe86f01406a40e63cd36e3fccafa6bf7f2 | |
parent | 81c9a3f1c3d4a64b4404c010ceda364c2afd9e7c (diff) | |
download | mandoc-6a2359747f92ffc48b612b8fb8a2e7a87a9dff8f.tar.gz |
Proper handling of `Rs' blocks in -Thtml.
-rw-r--r-- | example.style.css | 1 | ||||
-rw-r--r-- | mdoc_html.c | 22 |
2 files changed, 9 insertions, 14 deletions
diff --git a/example.style.css b/example.style.css index 99441efa..ad54850b 100644 --- a/example.style.css +++ b/example.style.css @@ -33,6 +33,7 @@ span.lit { font-family: monospace; } /* Literals (Bf -literal). */ span.macro { font-weight: bold; } /* Macro-ish thing (Fd). */ span.name { font-weight: bold; } /* Name of utility (Nm). */ span.opt { } /* Options (Op, Oo/Oc). */ +span.ref { } /* Citations (Rs). */ span.symb { font-weight: bold; } /* Symbols. */ span.type { font-style: italic; } /* Variable types (Vt). */ span.unix { } /* Unices (Ux, Ox, Nx, Fx, Bx, Bsx, Dx). */ diff --git a/mdoc_html.c b/mdoc_html.c index 2d93cca1..f2e931ce 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -2015,26 +2015,20 @@ mdoc_pf_post(MDOC_ARGS) static int mdoc_rs_pre(MDOC_ARGS) { - struct htmlpair tag[2]; - int i; + struct htmlpair tag; if (MDOC_BLOCK != n->type) return(1); - tag[i = 0].key = ATTR_CLASS; - tag[i++].val = "ref"; - - if (n->prev && SEC_SYNOPSIS == n->sec) { - tag[i].key = ATTR_STYLE; - tag[i++].val = "margin-top: 1em;"; - } else if (SEC_SYNOPSIS != n->sec) { - tag[i].key = ATTR_STYLE; - tag[i++].val = "display: inline; margin-right: 1em"; + if (n->prev && SEC_SEE_ALSO == n->sec) { + tag.key = ATTR_STYLE; + tag.val = "margin-top: 1em;"; + print_otag(h, TAG_DIV, 1, &tag); } - /* FIXME: div's have spaces stripped--we want them. */ - - print_otag(h, TAG_DIV, i, tag); + tag.key = ATTR_CLASS; + tag.val = "ref"; + print_otag(h, TAG_SPAN, 1, &tag); return(1); } |