summaryrefslogtreecommitdiffstats
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-12-31 10:35:56 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-12-31 10:35:56 +0000
commitf9d6a388c7174b643976ec3e793b5a1c601cdef1 (patch)
tree60957d55c09b6a230ef6a539cb37c40567f4503d /mdoc_html.c
parent8162fc91fb67e57190cd34b5420c91a5707f974b (diff)
downloadmandoc-f9d6a388c7174b643976ec3e793b5a1c601cdef1.tar.gz
Cleanup, no functional change:
Stop trying to keep fill mode state locally in the mdoc HTML formatter, rely on the state stored in the nodes instead. Note that the .Bd -literal code is buggy. Nested literal displays result in nested <pre> elements, which violates HTML syntax. But i'm not yet fixing bugs in this commit, i'm merely deleting code which has no effect.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index c05d00d0..44df869b 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -366,7 +366,8 @@ print_mdoc_node(MDOC_ARGS)
* (i.e., within a <PRE>) don't print the newline.
*/
if (*n->string == ' ' && n->flags & NODE_LINE &&
- (h->flags & (HTML_LITERAL | HTML_NONEWLINE)) == 0)
+ (h->flags & HTML_NONEWLINE) == 0 &&
+ (n->flags & NODE_NOFILL) == 0)
print_otag(h, TAG_BR, "");
if (NODE_DELIMC & n->flags)
h->flags |= HTML_NOSPACE;
@@ -915,7 +916,7 @@ mdoc_sx_pre(MDOC_ARGS)
static int
mdoc_bd_pre(MDOC_ARGS)
{
- int comp, sv;
+ int comp;
struct roff_node *nn;
if (n->type == ROFFT_HEAD)
@@ -949,12 +950,6 @@ mdoc_bd_pre(MDOC_ARGS)
return 1;
print_otag(h, TAG_PRE, "c", "Li");
-
- /* This can be recursive: save & set our literal state. */
-
- sv = h->flags & HTML_LITERAL;
- h->flags |= HTML_LITERAL;
-
for (nn = n->child; nn; nn = nn->next) {
print_mdoc_node(meta, nn, h);
/*
@@ -983,10 +978,6 @@ mdoc_bd_pre(MDOC_ARGS)
h->flags |= HTML_NOSPACE;
}
-
- if (0 == sv)
- h->flags &= ~HTML_LITERAL;
-
return 0;
}