diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-11-26 01:51:46 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-11-26 01:51:46 +0000 |
commit | 7afb42b3f0ce890a6e9f9d04f3ee354e8309f63e (patch) | |
tree | c4d2482cf1112063d58272041afa501ee3617be3 /tbl_html.c | |
parent | 37a9c2800e52ed5cc47923cb4cf5eb39453ba4b7 (diff) | |
download | mandoc-7afb42b3f0ce890a6e9f9d04f3ee354e8309f63e.tar.gz |
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.
Diffstat (limited to 'tbl_html.c')
-rw-r--r-- | tbl_html.c | 20 |
1 files changed, 4 insertions, 16 deletions
@@ -175,22 +175,10 @@ print_tbl(struct html *h, const struct tbl_span *sp) /* 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); } |