* mandoc: Simplify writing of tbl(7) cells by using the new feature of
@ 2018-11-26 1:52 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2018-11-26 1:52 UTC (permalink / raw)
To: source
Log Message:
-----------
Simplify writing of tbl(7) cells by using the new feature of passing
a NULL pointer for the value of a style attribute, in which case
the attribute is omitted from the HTML element.
Minus 12 lines of ugly and repetitive code, no functional change.
Modified Files:
--------------
mandoc:
tbl_html.c
Revision Data
-------------
Index: tbl_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/tbl_html.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -Ltbl_html.c -Ltbl_html.c -u -p -r1.27 -r1.28
--- tbl_html.c
+++ tbl_html.c
@@ -175,22 +175,10 @@ print_tbl(struct html *h, const struct t
/* Print the element and the attributes. */
- if (halign == NULL && valign == NULL)
- print_otag(h, TAG_TD, "??",
- "colspan", hspans, "rowspan", vspans);
- else if (halign == NULL)
- print_otag(h, TAG_TD, "??s",
- "colspan", hspans, "rowspan", vspans,
- "vertical-align", valign);
- else if (valign == NULL)
- print_otag(h, TAG_TD, "??s",
- "colspan", hspans, "rowspan", vspans,
- "text-align", halign);
- else
- print_otag(h, TAG_TD, "??ss",
- "colspan", hspans, "rowspan", vspans,
- "vertical-align", valign,
- "text-align", halign);
+ print_otag(h, TAG_TD, "??ss",
+ "colspan", hspans, "rowspan", vspans,
+ "vertical-align", valign,
+ "text-align", halign);
if (dp->string != NULL)
print_text(h, dp->string);
}
--
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-11-26 1:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-26 1:52 mandoc: Simplify writing of tbl(7) cells by using the new feature of 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).