From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: Simplify writing of tbl(7) cells by using the new feature of
Date: Sun, 25 Nov 2018 20:52:16 -0500 (EST) [thread overview]
Message-ID: <381d7c8988c3c213@fantadrom.bsd.lv> (raw)
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
reply other threads:[~2018-11-26 1:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=381d7c8988c3c213@fantadrom.bsd.lv \
--to=schwarze@mandoc.bsd.lv \
--cc=source@mandoc.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).