mdoc_html.c revision 698f87a48e2e945bfe5493ce168e0d0ae1cedd5c
/* $Id: mdoc_html.c,v 1.186 2013/12/24 20:45:27 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "mandoc.h"
#include "out.h"
#include "html.h"
#include "mdoc.h"
#include "main.h"
#define INDENT 5
const struct mdoc_node *n, \
struct html *h
#ifndef MIN
#define MIN(a,b) ((/*CONSTCOND*/(a)<(b))?(a):(b))
#endif
struct htmlmdoc {
};
static void print_mdoc(MDOC_ARGS);
static void print_mdoc_head(MDOC_ARGS);
static void print_mdoc_node(MDOC_ARGS);
static void print_mdoc_nodelist(MDOC_ARGS);
static void synopsis_pre(struct html *,
const struct mdoc_node *);
static void mdoc_root_post(MDOC_ARGS);
static int mdoc_root_pre(MDOC_ARGS);
static void mdoc__x_post(MDOC_ARGS);
static int mdoc__x_pre(MDOC_ARGS);
static int mdoc_ad_pre(MDOC_ARGS);
static int mdoc_an_pre(MDOC_ARGS);
static int mdoc_ap_pre(MDOC_ARGS);
static int mdoc_ar_pre(MDOC_ARGS);
static int mdoc_bd_pre(MDOC_ARGS);
static int mdoc_bf_pre(MDOC_ARGS);
static void mdoc_bk_post(MDOC_ARGS);
static int mdoc_bk_pre(MDOC_ARGS);
static int mdoc_bl_pre(MDOC_ARGS);
static int mdoc_bt_pre(MDOC_ARGS);
static int mdoc_bx_pre(MDOC_ARGS);
static int mdoc_cd_pre(MDOC_ARGS);
static int mdoc_d1_pre(MDOC_ARGS);
static int mdoc_dv_pre(MDOC_ARGS);
static int mdoc_fa_pre(MDOC_ARGS);
static int mdoc_fd_pre(MDOC_ARGS);
static int mdoc_fl_pre(MDOC_ARGS);
static int mdoc_fn_pre(MDOC_ARGS);
static int mdoc_ft_pre(MDOC_ARGS);
static int mdoc_em_pre(MDOC_ARGS);
static int mdoc_er_pre(MDOC_ARGS);
static int mdoc_ev_pre(MDOC_ARGS);
static int mdoc_ex_pre(MDOC_ARGS);
static void mdoc_fo_post(MDOC_ARGS);
static int mdoc_fo_pre(MDOC_ARGS);
static int mdoc_ic_pre(MDOC_ARGS);
static int mdoc_igndelim_pre(MDOC_ARGS);
static int mdoc_in_pre(MDOC_ARGS);
static int mdoc_it_pre(MDOC_ARGS);
static int mdoc_lb_pre(MDOC_ARGS);
static int mdoc_li_pre(MDOC_ARGS);
static int mdoc_lk_pre(MDOC_ARGS);
static int mdoc_mt_pre(MDOC_ARGS);
static int mdoc_ms_pre(MDOC_ARGS);
static int mdoc_nd_pre(MDOC_ARGS);
static int mdoc_nm_pre(MDOC_ARGS);
static int mdoc_ns_pre(MDOC_ARGS);
static int mdoc_pa_pre(MDOC_ARGS);
static void mdoc_pf_post(MDOC_ARGS);
static int mdoc_pp_pre(MDOC_ARGS);
static void mdoc_quote_post(MDOC_ARGS);
static int mdoc_quote_pre(MDOC_ARGS);
static int mdoc_rs_pre(MDOC_ARGS);
static int mdoc_rv_pre(MDOC_ARGS);
static int mdoc_sh_pre(MDOC_ARGS);
static int mdoc_sm_pre(MDOC_ARGS);
static int mdoc_sp_pre(MDOC_ARGS);
static int mdoc_ss_pre(MDOC_ARGS);
static int mdoc_sx_pre(MDOC_ARGS);
static int mdoc_sy_pre(MDOC_ARGS);
static int mdoc_ud_pre(MDOC_ARGS);
static int mdoc_va_pre(MDOC_ARGS);
static int mdoc_vt_pre(MDOC_ARGS);
static int mdoc_xr_pre(MDOC_ARGS);
static int mdoc_xx_pre(MDOC_ARGS);
};
NULL,
"list-bul",
"list-col",
"list-dash",
"list-diag",
"list-enum",
"list-hang",
"list-hyph",
"list-inset",
"list-item",
"list-ohang",
"list-tag"
};
void
{
putchar('\n');
}
/*
* Calculate the scaling unit passed in a `-width' argument. This uses
* either a native scaling unit (e.g., 1i, 2m) or the string length of
* the value.
*/
static void
{
}
}
/*
* See the same function in mdoc_term.c for documentation.
*/
static void
{
return;
return;
}
case (MDOC_Fd):
/* FALLTHROUGH */
case (MDOC_Fn):
/* FALLTHROUGH */
case (MDOC_Fo):
/* FALLTHROUGH */
case (MDOC_In):
/* FALLTHROUGH */
case (MDOC_Vt):
break;
case (MDOC_Ft):
break;
}
/* FALLTHROUGH */
default:
break;
}
}
/*
* Calculate the scaling unit passed in an `-offset' argument. This
* uses either a native scaling unit (e.g., 1i, 2m), one of a set of
* predefined strings (indent, etc.), or the string length of the value.
*/
static void
{
/* FIXME: "right"? */
if (0 == strcmp(p, "left"))
SCALE_HS_INIT(su, 0);
else if (0 == strcmp(p, "indent"))
else if (0 == strcmp(p, "indent-two"))
}
static void
{
if ( ! (HTML_FRAGMENT & h->oflags)) {
print_gen_decls(h);
print_mdoc_head(meta, n, h);
print_tagq(h, tt);
} else
print_mdoc_nodelist(meta, n, h);
print_tagq(h, t);
}
/* ARGSUSED */
static void
{
print_gen_head(h);
bufinit(h);
print_text(h, h->buf);
}
static void
{
print_mdoc_node(meta, n, h);
if (n->next)
}
static void
{
int child;
struct tag *t;
child = 1;
switch (n->type) {
case (MDOC_ROOT):
break;
case (MDOC_TEXT):
/* No tables in this mode... */
/*
* Make sure that if we're in a literal mode already
* (i.e., within a <PRE>) don't print the newline.
*/
if ( ! (HTML_LITERAL & h->flags))
if (MDOC_DELIMC & n->flags)
h->flags |= HTML_NOSPACE;
print_text(h, n->string);
if (MDOC_DELIMO & n->flags)
h->flags |= HTML_NOSPACE;
return;
case (MDOC_EQN):
break;
case (MDOC_TBL):
/*
* This will take care of initialising all of the table
* state data for the first table, then tearing it down
* for the last one.
*/
return;
default:
/*
* Close out the current table, if it's open, and unset
* the "meta" table state. This will be reopened on the
* next table element.
*/
if (h->tblt) {
print_tblclose(h);
}
break;
}
h->flags |= HTML_PREKEEP;
}
}
print_stagq(h, t);
switch (n->type) {
case (MDOC_ROOT):
mdoc_root_post(meta, n, h);
break;
case (MDOC_EQN):
break;
default:
break;
}
}
/* ARGSUSED */
static void
{
print_stagq(h, tt);
print_tagq(h, t);
}
/* ARGSUSED */
static int
{
}
print_text(h, title);
print_stagq(h, tt);
print_text(h, b);
print_stagq(h, tt);
print_text(h, title);
print_tagq(h, t);
return(1);
}
/* ARGSUSED */
static int
{
if (MDOC_BLOCK == n->type) {
return(1);
return(1);
bufinit(h);
bufcat(h, "x");
bufcat_id(h, " ");
}
if (NULL == n) {
} else
return(1);
}
/* ARGSUSED */
static int
{
if (MDOC_BLOCK == n->type) {
return(1);
return(1);
bufinit(h);
bufcat(h, "x");
bufcat_id(h, " ");
}
if (NULL == n) {
} else
return(1);
}
/* ARGSUSED */
static int
{
/* `Cm' has no leading hyphen. */
return(1);
print_text(h, "\\-");
if (n->child)
h->flags |= HTML_NOSPACE;
h->flags |= HTML_NOSPACE;
return(1);
}
/* ARGSUSED */
static int
{
return(1);
/* XXX: this tag in theory can contain block elements. */
print_text(h, "\\(em");
return(1);
}
static int
{
int len;
switch (n->type) {
case (MDOC_ELEM):
synopsis_pre(h, n);
return(1);
case (MDOC_HEAD):
return(1);
case (MDOC_BODY):
return(1);
default:
break;
}
synopsis_pre(h, n);
bufinit(h);
PAIR_STYLE_INIT(&tag, h);
return(1);
}
/* ARGSUSED */
static int
{
return(0);
if (h->base_man) {
} else
n = n->child;
print_text(h, n->string);
return(0);
h->flags |= HTML_NOSPACE;
print_text(h, "(");
h->flags |= HTML_NOSPACE;
print_text(h, n->string);
h->flags |= HTML_NOSPACE;
print_text(h, ")");
return(0);
}
/* ARGSUSED */
static int
{
h->flags |= HTML_NOSPACE;
return(1);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
const char *pp;
int flags;
switch (n->tok) {
case (MDOC_Bsx):
break;
case (MDOC_Dx):
pp = "DragonFly";
break;
case (MDOC_Fx):
pp = "FreeBSD";
break;
case (MDOC_Nx):
pp = "NetBSD";
break;
case (MDOC_Ox):
pp = "OpenBSD";
break;
case (MDOC_Ux):
pp = "UNIX";
break;
default:
return(1);
}
print_text(h, pp);
if (n->child) {
}
return(0);
}
/* ARGSUSED */
static int
{
print_text(h, n->string);
h->flags |= HTML_NOSPACE;
print_text(h, "BSD");
} else {
print_text(h, "BSD");
return(0);
}
h->flags |= HTML_NOSPACE;
print_text(h, "-");
h->flags |= HTML_NOSPACE;
print_text(h, n->string);
}
return(0);
}
/* ARGSUSED */
static int
{
bufinit(h);
switch (type) {
case(LIST_bullet):
/* FALLTHROUGH */
case(LIST_dash):
/* FALLTHROUGH */
case(LIST_item):
/* FALLTHROUGH */
case(LIST_hyphen):
/* FALLTHROUGH */
case(LIST_enum):
return(0);
case(LIST_diag):
/* FALLTHROUGH */
case(LIST_hang):
/* FALLTHROUGH */
case(LIST_inset):
/* FALLTHROUGH */
case(LIST_ohang):
/* FALLTHROUGH */
case(LIST_tag):
break;
break;
case(LIST_column):
break;
default:
break;
}
switch (type) {
case(LIST_bullet):
/* FALLTHROUGH */
case(LIST_hyphen):
/* FALLTHROUGH */
case(LIST_dash):
/* FALLTHROUGH */
case(LIST_enum):
/* FALLTHROUGH */
case(LIST_item):
break;
case(LIST_diag):
/* FALLTHROUGH */
case(LIST_hang):
/* FALLTHROUGH */
case(LIST_inset):
/* FALLTHROUGH */
case(LIST_ohang):
/* FALLTHROUGH */
case(LIST_tag):
break;
}
break;
case(LIST_column):
break;
default:
break;
}
} else {
switch (type) {
case (LIST_column):
break;
default:
break;
}
}
return(1);
}
/* ARGSUSED */
static int
{
int i;
return(1);
}
return(0);
/*
* For each column, print out the <COL> tag with our
* suggested width. The last column gets min-width, as
* in terminal mode it auto-sizes to the width of the
* screen and we want to preserve that behaviour.
*/
bufinit(h);
else
PAIR_STYLE_INIT(&tag[0], h);
}
return(0);
}
SCALE_VS_INIT(&su, 0);
bufinit(h);
PAIR_STYLE_INIT(&tag[0], h);
/* Set the block's left-hand margin. */
}
case(LIST_bullet):
/* FALLTHROUGH */
case(LIST_dash):
/* FALLTHROUGH */
case(LIST_hyphen):
/* FALLTHROUGH */
case(LIST_item):
break;
case(LIST_enum):
break;
case(LIST_diag):
/* FALLTHROUGH */
case(LIST_hang):
/* FALLTHROUGH */
case(LIST_inset):
/* FALLTHROUGH */
case(LIST_ohang):
/* FALLTHROUGH */
case(LIST_tag):
break;
case(LIST_column):
break;
default:
abort();
/* NOTREACHED */
}
return(1);
}
/* ARGSUSED */
static int
{
struct tag *t;
int nchild;
if (n->prev)
print_text(h, "The");
print_text(h, n->string);
print_tagq(h, t);
h->flags |= HTML_NOSPACE;
print_text(h, ",");
}
print_text(h, "and");
}
if (nchild > 1)
print_text(h, "utilities exit");
else
print_text(h, "utility exits");
print_text(h, "0 on success, and >0 if an error occurs.");
return(0);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
if (MDOC_BLOCK != n->type)
return(1);
SCALE_VS_INIT(&su, 0);
bufinit(h);
PAIR_STYLE_INIT(&tag[0], h);
/* BLOCKQUOTE needs a block body. */
}
return(1);
}
/* ARGSUSED */
static int
{
bufinit(h);
bufcat(h, "#x");
for (n = n->child; n; ) {
bufcat_id(h, " ");
}
return(1);
}
/* ARGSUSED */
static int
{
return(0);
if (MDOC_BLOCK == n->type) {
continue;
comp = 1;
break;
}
if ( ! comp)
return(1);
}
SCALE_HS_INIT(&su, 0);
bufinit(h);
PAIR_STYLE_INIT(&tag[0], h);
return(1);
}
/* This can be recursive: save & set our literal state. */
h->flags |= HTML_LITERAL;
/*
* If the printed node flushes its own line, then we
* needn't do it here as well. This is hacky, but the
* notion of selective eoln whitespace is pretty dumb
* anyway, so don't sweat it.
*/
case (MDOC_Sm):
/* FALLTHROUGH */
case (MDOC_br):
/* FALLTHROUGH */
case (MDOC_sp):
/* FALLTHROUGH */
case (MDOC_Bl):
/* FALLTHROUGH */
case (MDOC_D1):
/* FALLTHROUGH */
case (MDOC_Dl):
/* FALLTHROUGH */
case (MDOC_Lp):
/* FALLTHROUGH */
case (MDOC_Pp):
continue;
default:
break;
}
continue;
print_text(h, "\n");
h->flags |= HTML_NOSPACE;
}
if (0 == sv)
h->flags &= ~HTML_LITERAL;
return(0);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
/* TODO: -split and -nosplit (see termp_an_pre()). */
return(1);
}
/* ARGSUSED */
static int
{
synopsis_pre(h, n);
return(1);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
struct tag *t;
return(1);
}
print_tagq(h, t);
h->flags |= HTML_NOSPACE;
print_text(h, ",");
}
}
h->flags |= HTML_NOSPACE;
print_text(h, ",");
}
return(0);
}
/* ARGSUSED */
static int
{
int i;
struct tag *t;
synopsis_pre(h, n);
return(0);
return(1);
}
print_text(h, n->string);
i = 1;
if (h->base_includes) {
buffmt_includes(h, buf);
i++;
}
print_text(h, n->string);
print_tagq(h, t);
n = n->next;
}
for ( ; n; n = n->next) {
print_text(h, n->string);
}
return(0);
}
/* ARGSUSED */
static int
{
if (MDOC_BLOCK == n->type) {
synopsis_pre(h, n);
return(1);
synopsis_pre(h, n);
return(0);
return(1);
}
/* ARGSUSED */
static int
{
synopsis_pre(h, n);
return(1);
}
/* ARGSUSED */
static int
{
struct tag *t;
synopsis_pre(h, n);
/* Split apart into type and name. */
while (ep) {
print_text(h, nbuf);
}
print_tagq(h, t);
}
/*
* FIXME: only refer to IDs that we know exist.
*/
#if 0
if (MDOC_SYNPRETTY & n->flags) {
nbuf[0] = '\0';
} else {
}
#endif
if (sp) {
print_text(h, nbuf);
}
print_tagq(h, t);
h->flags |= HTML_NOSPACE;
print_text(h, "(");
h->flags |= HTML_NOSPACE;
bufinit(h);
i = 1;
if (MDOC_SYNPRETTY & n->flags)
i = 2;
print_text(h, n->string);
print_tagq(h, t);
if (n->next) {
h->flags |= HTML_NOSPACE;
print_text(h, ",");
}
}
h->flags |= HTML_NOSPACE;
print_text(h, ")");
if (pretty) {
h->flags |= HTML_NOSPACE;
print_text(h, ";");
}
return(0);
}
/* ARGSUSED */
static int
{
/*
* FIXME: no p->col to check. Thus, if we have
* .Bd -literal
* .Sm off
* 1 2
* .Sm on
* 3
* .Ed
* the "3" is preceded by a space.
*/
h->flags &= ~HTML_NOSPACE;
h->flags &= ~HTML_NONOSPACE;
} else
h->flags |= HTML_NONOSPACE;
return(0);
}
/* ARGSUSED */
static int
{
return(0);
}
/* ARGSUSED */
static int
{
} else
bufinit(h);
PAIR_STYLE_INIT(&tag, h);
/* So the div isn't empty: */
print_text(h, "\\~");
return(0);
}
/* ARGSUSED */
static int
{
return(0);
print_text(h, n->string);
print_text(h, n->string);
return(0);
}
/* ARGSUSED */
static int
{
struct tag *t;
bufinit(h);
bufcat(h, "mailto:");
print_text(h, n->string);
print_tagq(h, t);
}
return(0);
}
/* ARGSUSED */
static int
{
struct tag *t;
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. */
print_tagq(h, t);
return(0);
}
/* ARGSUSED */
static void
{
return;
h->flags |= HTML_NOSPACE;
print_text(h, ")");
h->flags |= HTML_NOSPACE;
print_text(h, ";");
}
/* ARGSUSED */
static int
{
struct tag *t;
int i;
synopsis_pre(h, n);
/*
* The first argument of the `In' gets special treatment as
* being a linked value. Subsequent values are printed
* afterward. groff does similarly. This also handles the case
* of no children.
*/
print_text(h, "#include");
print_text(h, "<");
h->flags |= HTML_NOSPACE;
i = 1;
if (h->base_includes) {
buffmt_includes(h, n->string);
i++;
}
print_text(h, n->string);
print_tagq(h, t);
n = n->next;
}
h->flags |= HTML_NOSPACE;
print_text(h, ">");
for ( ; n; n = n->next) {
print_text(h, n->string);
}
return(0);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
struct tag *t;
int nchild;
if (n->prev)
print_text(h, "The");
print_text(h, n->string);
print_tagq(h, t);
h->flags |= HTML_NOSPACE;
print_text(h, "()");
h->flags |= HTML_NOSPACE;
print_text(h, ",");
}
print_text(h, "and");
}
if (nchild > 1)
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");
print_text(h, "errno");
print_tagq(h, t);
print_text(h, "is set to indicate the error.");
return(0);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
h->flags |= HTML_NOSPACE;
print_text(h, "\\(aq");
h->flags |= HTML_NOSPACE;
return(1);
}
/* ARGSUSED */
static int
{
return(0);
return(1);
else
/*
* We want this to be inline-formatted, but needs to be div to
* accept block children.
*/
bufinit(h);
/* Needs a left-margin for spacing. */
return(1);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
h->flags |= HTML_IGNDELIM;
return(1);
}
/* ARGSUSED */
static void
{
h->flags |= HTML_NOSPACE;
}
/* ARGSUSED */
static int
{
if (MDOC_BLOCK != n->type)
return(1);
return(1);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
print_text(h, "is currently in beta test.");
return(0);
}
/* ARGSUSED */
static int
{
print_text(h, "currently under development.");
return(0);
}
/* ARGSUSED */
static int
{
return(1);
}
/* ARGSUSED */
static int
{
enum htmltag t;
t = TAG_SPAN;
switch (n->tok) {
case(MDOC__A):
print_text(h, "and");
break;
case(MDOC__B):
t = TAG_I;
break;
case(MDOC__C):
break;
case(MDOC__D):
break;
case(MDOC__I):
t = TAG_I;
break;
case(MDOC__J):
t = TAG_I;
break;
case(MDOC__N):
break;
case(MDOC__O):
break;
case(MDOC__P):
break;
case(MDOC__Q):
break;
case(MDOC__R):
break;
case(MDOC__T):
break;
case(MDOC__U):
break;
case(MDOC__V):
break;
default:
abort();
/* NOTREACHED */
}
return(1);
}
return(1);
}
/* ARGSUSED */
static void
{
return;
/* TODO: %U */
return;
h->flags |= HTML_NOSPACE;
}
/* ARGSUSED */
static int
{
switch (n->type) {
case (MDOC_BLOCK):
break;
case (MDOC_HEAD):
return(0);
case (MDOC_BODY):
h->flags |= HTML_PREKEEP;
break;
default:
abort();
/* NOTREACHED */
}
return(1);
}
/* ARGSUSED */
static void
{
}
/* ARGSUSED */
static int
{
return(1);
switch (n->tok) {
case (MDOC_Ao):
/* FALLTHROUGH */
case (MDOC_Aq):
print_text(h, "\\(la");
break;
case (MDOC_Bro):
/* FALLTHROUGH */
case (MDOC_Brq):
print_text(h, "\\(lC");
break;
case (MDOC_Bo):
/* FALLTHROUGH */
case (MDOC_Bq):
print_text(h, "\\(lB");
break;
case (MDOC_Oo):
/* FALLTHROUGH */
case (MDOC_Op):
print_text(h, "\\(lB");
h->flags |= HTML_NOSPACE;
break;
case (MDOC_Eo):
break;
case (MDOC_Do):
/* FALLTHROUGH */
case (MDOC_Dq):
/* FALLTHROUGH */
case (MDOC_Qo):
/* FALLTHROUGH */
case (MDOC_Qq):
print_text(h, "\\(lq");
break;
case (MDOC_Po):
/* FALLTHROUGH */
case (MDOC_Pq):
print_text(h, "(");
break;
case (MDOC_Ql):
print_text(h, "\\(oq");
h->flags |= HTML_NOSPACE;
break;
case (MDOC_So):
/* FALLTHROUGH */
case (MDOC_Sq):
print_text(h, "\\(oq");
break;
default:
abort();
/* NOTREACHED */
}
h->flags |= HTML_NOSPACE;
return(1);
}
/* ARGSUSED */
static void
{
return;
h->flags |= HTML_NOSPACE;
switch (n->tok) {
case (MDOC_Ao):
/* FALLTHROUGH */
case (MDOC_Aq):
print_text(h, "\\(ra");
break;
case (MDOC_Bro):
/* FALLTHROUGH */
case (MDOC_Brq):
print_text(h, "\\(rC");
break;
case (MDOC_Oo):
/* FALLTHROUGH */
case (MDOC_Op):
/* FALLTHROUGH */
case (MDOC_Bo):
/* FALLTHROUGH */
case (MDOC_Bq):
print_text(h, "\\(rB");
break;
case (MDOC_Eo):
break;
case (MDOC_Qo):
/* FALLTHROUGH */
case (MDOC_Qq):
/* FALLTHROUGH */
case (MDOC_Do):
/* FALLTHROUGH */
case (MDOC_Dq):
print_text(h, "\\(rq");
break;
case (MDOC_Po):
/* FALLTHROUGH */
case (MDOC_Pq):
print_text(h, ")");
break;
case (MDOC_Ql):
/* FALLTHROUGH */
case (MDOC_So):
/* FALLTHROUGH */
case (MDOC_Sq):
print_text(h, "\\(cq");
break;
default:
abort();
/* NOTREACHED */
}
}