source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: If the layout or data of an individual cell in a tbl(7) contains
@ 2021-09-09 14:47 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2021-09-09 14:47 UTC (permalink / raw)
  To: source

Log Message:
-----------
If the layout or data of an individual cell in a tbl(7) contains
only "_", "-", or "=", requesting a horizontal line to be drawn
across the middle of the cell, print <hr/> in that cell in HTML
output.

That is arguably slightly ugly because HTML 5 regards <hr/> as
semantic markup, meaning "thematic break".  If somebody knowns  
a better way to render a horizontal line across the middle of a
table cell with pure HTML and CSS, and without implying a specific
meaning, please tell me.

Missing feature reported by <Oliver dot Corff at email dot de>.

Modified Files:
--------------
    mandoc:
        html.h
        html.c
        tbl_html.c

Revision Data
-------------
Index: html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.c,v
retrieving revision 1.274
retrieving revision 1.275
diff -Lhtml.c -Lhtml.c -u -p -r1.274 -r1.275
--- html.c
+++ html.c
@@ -91,6 +91,7 @@ static	const struct htmldata htmltags[TA
 	{"span",	HTML_INPHRASE | HTML_TOPHRASE},
 	{"var",		HTML_INPHRASE | HTML_TOPHRASE},
 	{"br",		HTML_INPHRASE | HTML_NOSTACK | HTML_NLALL},
+	{"hr",		HTML_INPHRASE | HTML_NOSTACK},
 	{"mark",	HTML_INPHRASE },
 	{"math",	HTML_INPHRASE | HTML_NLALL | HTML_INDENT},
 	{"mrow",	0},
Index: html.h
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.h,v
retrieving revision 1.108
retrieving revision 1.109
diff -Lhtml.h -Lhtml.h -u -p -r1.108 -r1.109
--- html.h
+++ html.h
@@ -51,6 +51,7 @@ enum	htmltag {
 	TAG_SPAN,
 	TAG_VAR,
 	TAG_BR,
+	TAG_HR,
 	TAG_MARK,
 	TAG_MATH,
 	TAG_MROW,
Index: tbl_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/tbl_html.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -Ltbl_html.c -Ltbl_html.c -u -p -r1.36 -r1.37
--- tbl_html.c
+++ tbl_html.c
@@ -241,7 +241,12 @@ print_tbl(struct html *h, const struct t
 		    "vertical-align", valign,
 		    "text-align", halign,
 		    "border-right-style", rborder);
-		if (dp->string != NULL) {
+		if (dp->layout->pos == TBL_CELL_HORIZ ||
+		    dp->layout->pos == TBL_CELL_DHORIZ ||
+		    dp->pos == TBL_DATA_HORIZ ||
+		    dp->pos == TBL_DATA_DHORIZ)
+			print_otag(h, TAG_HR, "");
+		else if (dp->string != NULL) {
 			save_font = h->metac;
 			html_setfont(h, dp->layout->font);
 			if (dp->layout->pos == TBL_CELL_LONG)
--
 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:[~2021-09-09 14:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 14:47 mandoc: If the layout or data of an individual cell in a tbl(7) contains 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).