-/* $Id: man_html.c,v 1.138 2017/05/04 22:16:09 schwarze Exp $ */
+/* $Id: man_html.c,v 1.143 2017/06/08 12:54:58 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
static int man_in_pre(MAN_ARGS);
static void man_root_post(MAN_ARGS);
static void man_root_pre(MAN_ARGS);
-static int man_sp_pre(MAN_ARGS);
static const struct htmlman __mans[MAN_MAX - MAN_TH] = {
{ NULL, NULL }, /* TH */
{ man_I_pre, NULL }, /* I */
{ man_alt_pre, NULL }, /* IR */
{ man_alt_pre, NULL }, /* RI */
- { man_sp_pre, NULL }, /* sp */
{ NULL, NULL }, /* nf */
{ NULL, NULL }, /* fi */
{ NULL, NULL }, /* RE */
{ man_ign_pre, NULL }, /* PD */
{ man_ign_pre, NULL }, /* AT */
{ man_in_pre, NULL }, /* in */
- { man_ign_pre, NULL }, /* ft */
{ man_OP_pre, NULL }, /* OP */
{ NULL, NULL }, /* EX */
{ NULL, NULL }, /* EE */
{ man_UR_pre, NULL }, /* UR */
{ NULL, NULL }, /* UE */
- { man_ign_pre, NULL }, /* ll */
};
static const struct htmlman *const mans = __mans - MAN_TH;
case ROFFT_TEXT:
if (fillmode(h, want_fillmode) == MAN_fi &&
want_fillmode == MAN_fi &&
- n->flags & NODE_LINE && *n->string == ' ')
+ n->flags & NODE_LINE && *n->string == ' ' &&
+ (h->flags & HTML_NONEWLINE) == 0)
print_otag(h, TAG_BR, "");
if (*n->string != '\0')
break;
t = h->tag;
if (n->tok < ROFF_MAX) {
roff_html_pre(h, n);
+ child = 0;
break;
}
static int
a2width(const struct roff_node *n, struct roffsu *su)
{
-
if (n->type != ROFFT_TEXT)
return 0;
- if (a2roffsu(n->string, su, SCALE_EN))
- return 1;
-
- return 0;
+ return a2roffsu(n->string, su, SCALE_EN) != NULL;
}
static void
print_tagq(h, t);
}
-
-static int
-man_sp_pre(MAN_ARGS)
-{
- struct roffsu su;
-
- SCALE_VS_INIT(&su, 1);
- if (NULL != (n = n->child))
- if ( ! a2roffsu(n->string, &su, SCALE_VS))
- su.scale = 1.0;
-
- print_otag(h, TAG_DIV, "suh", &su);
-
- /* So the div isn't empty: */
- print_text(h, "\\~");
-
- return 0;
-}
-
static int
man_SH_pre(MAN_ARGS)
{