From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id f3aebf81 for ; Sun, 25 Nov 2018 20:52:16 -0500 (EST) Date: Sun, 25 Nov 2018 20:52:16 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: Simplify writing of tbl(7) cells by using the new feature of X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-Id: <381d7c8988c3c213@fantadrom.bsd.lv> 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