+ /* So the div isn't empty: */
+ print_text(h, "\\~");
+
+ return(0);
+
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_brq_pre(MDOC_ARGS)
+{
+
+ if (MDOC_BODY != n->type)
+ return(1);
+ print_text(h, "\\(lC");
+ h->flags |= HTML_NOSPACE;
+ return(1);
+}
+
+
+/* ARGSUSED */
+static void
+mdoc_brq_post(MDOC_ARGS)
+{
+
+ if (MDOC_BODY != n->type)
+ return;
+ h->flags |= HTML_NOSPACE;
+ print_text(h, "\\(rC");
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_lk_pre(MDOC_ARGS)
+{
+ const struct mdoc_node *nn;
+ struct htmlpair tag[2];
+
+ nn = n->child;
+
+ PAIR_CLASS_INIT(&tag[0], "link-ext");
+ PAIR_HREF_INIT(&tag[1], nn->string);
+ print_otag(h, TAG_A, 2, tag);
+
+ if (NULL == nn->next)
+ return(1);
+
+ for (nn = nn->next; nn; nn = nn->next)
+ print_text(h, nn->string);
+
+ return(0);
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_mt_pre(MDOC_ARGS)
+{
+ struct htmlpair tag[2];
+ struct tag *t;
+ const struct mdoc_node *nn;
+
+ PAIR_CLASS_INIT(&tag[0], "link-mail");
+
+ for (nn = n->child; nn; nn = nn->next) {
+ bufinit(h);
+ bufcat(h, "mailto:");
+ bufcat(h, nn->string);
+ PAIR_HREF_INIT(&tag[1], h->buf);
+ t = print_otag(h, TAG_A, 2, tag);
+ print_text(h, nn->string);
+ print_tagq(h, t);
+ }
+
+ return(0);
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_fo_pre(MDOC_ARGS)
+{
+ struct htmlpair tag;
+ 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) {
+ synopsis_pre(h, n);
+ return(1);
+ }
+
+ /* XXX: we drop non-initial arguments as per groff. */
+
+ assert(n->child);
+ assert(n->child->string);
+
+ PAIR_CLASS_INIT(&tag, "fname");
+ t = print_otag(h, TAG_SPAN, 1, &tag);
+ print_text(h, n->child->string);
+ print_tagq(h, t);
+ return(0);
+}
+
+
+/* ARGSUSED */
+static void
+mdoc_fo_post(MDOC_ARGS)
+{
+
+ if (MDOC_BODY != n->type)
+ return;
+ h->flags |= HTML_NOSPACE;
+ print_text(h, ")");
+ h->flags |= HTML_NOSPACE;
+ print_text(h, ";");
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_in_pre(MDOC_ARGS)
+{
+ const struct mdoc_node *nn;
+ struct tag *t;
+ struct htmlpair tag[2];
+ int i;
+
+ synopsis_pre(h, n);
+
+ PAIR_CLASS_INIT(&tag[0], "includes");
+ print_otag(h, TAG_SPAN, 1, tag);
+
+ if (MDOC_SYNPRETTY & n->flags && MDOC_LINE & n->flags)
+ print_text(h, "#include");
+
+ print_text(h, "<");
+ h->flags |= HTML_NOSPACE;
+
+ for (nn = n->child; nn; nn = nn->next) {
+ PAIR_CLASS_INIT(&tag[0], "link-includes");
+ i = 1;
+ bufinit(h);
+ if (h->base_includes) {
+ buffmt_includes(h, nn->string);
+ PAIR_HREF_INIT(&tag[i], h->buf);
+ i++;
+ }
+ t = print_otag(h, TAG_A, i, tag);
+ print_mdoc_node(m, nn, h);
+ print_tagq(h, t);
+ }
+
+ h->flags |= HTML_NOSPACE;
+ print_text(h, ">");
+
+ return(0);
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_ic_pre(MDOC_ARGS)
+{
+ struct htmlpair tag;
+
+ PAIR_CLASS_INIT(&tag, "cmd");
+ print_otag(h, TAG_SPAN, 1, &tag);
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_rv_pre(MDOC_ARGS)
+{
+ const struct mdoc_node *nn;
+ struct htmlpair tag;
+ struct tag *t;
+
+ print_otag(h, TAG_DIV, 0, NULL);
+ print_text(h, "The");
+
+ for (nn = n->child; nn; nn = nn->next) {
+ PAIR_CLASS_INIT(&tag, "fname");
+ t = print_otag(h, TAG_SPAN, 1, &tag);
+ print_text(h, nn->string);
+ print_tagq(h, t);
+
+ h->flags |= HTML_NOSPACE;
+ if (nn->next && NULL == nn->next->next)
+ print_text(h, "(), and");
+ else if (nn->next)
+ print_text(h, "(),");
+ else
+ print_text(h, "()");
+ }
+
+ if (n->child && n->child->next)
+ print_text(h, "functions return");
+ else
+ print_text(h, "function returns");
+
+ print_text(h, "the value 0 if successful; otherwise the value "
+ "-1 is returned and the global variable");
+
+ PAIR_CLASS_INIT(&tag, "var");
+ t = print_otag(h, TAG_SPAN, 1, &tag);
+ print_text(h, "errno");
+ print_tagq(h, t);
+ print_text(h, "is set to indicate the error.");
+ return(0);
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_va_pre(MDOC_ARGS)
+{
+ struct htmlpair tag;
+
+ PAIR_CLASS_INIT(&tag, "var");
+ print_otag(h, TAG_SPAN, 1, &tag);
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_bq_pre(MDOC_ARGS)
+{
+
+ if (MDOC_BODY != n->type)
+ return(1);
+ print_text(h, "\\(lB");
+ h->flags |= HTML_NOSPACE;