* mandoc: Cleanup, no functional change: Stop trying to keep fill mode
@ 2018-12-31 10:36 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2018-12-31 10:36 UTC (permalink / raw)
To: source
Log Message:
-----------
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.
Modified Files:
--------------
mandoc:
mdoc_html.c
Revision Data
-------------
Index: mdoc_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mdoc_html.c,v
retrieving revision 1.321
retrieving revision 1.322
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.321 -r1.322
--- mdoc_html.c
+++ 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;
}
--
To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-12-31 10:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-31 10:36 mandoc: Cleanup, no functional change: Stop trying to keep fill mode schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).