source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Revert previous, as requested by kristaps@.
@ 2014-08-14  0:31 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-08-14  0:31 UTC (permalink / raw)
  To: source

Log Message:
-----------
Revert previous, as requested by kristaps@.
The .Bf block can contain subblocks, so it has to render as an 
element that can contain flow content.  But <em> cannot contain
flow content, only phrasing content.  Rendering .Em and .Bf differently
would by unfortunate, and closing out .Bf before subblocks and 
re-opening it afterwards would merely complicate both the C code
of the program and the generated HTML code.  Besides, converting
.Em to semantic HTML markup would require some content to be put
into <em> and some into <i>, but we cannot automatically distinguish
which is which, so strictly speaking, we can't use semantic HTML
here but have to fall back to physical markup.  Wonders of HTML...

Modified Files:
--------------
    mdocml:
        example.style.css
        html.c
        html.h
        mdoc_html.c
        style.css

Revision Data
-------------
Index: style.css
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/style.css,v
retrieving revision 1.26
retrieving revision 1.27
diff -Lstyle.css -Lstyle.css -u -p -r1.26 -r1.27
--- style.css
+++ style.css
@@ -34,7 +34,7 @@ td.head-rtitle	{ width: 10%; text-align:
 /* General font modes. */
 
 i		{ } /* Italic: BI, IB, I, (implicit). */
-em		{ font-style: italic; font-weight: normal; } /* Emphasis: Em, Bl -emphasis. */
+.emph		{ font-style: italic; font-weight: normal; } /* Emphasis: Em, Bl -emphasis. */
 b		{ } /* Bold: SB, BI, IB, BR, RB, B, (implicit). */
 .symb		{ font-style: normal; font-weight: bold; } /* Symbolic: Sy, Ms, Bf -symbolic. */
 small		{ } /* Small: SB, SM. */
Index: html.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -Lhtml.h -Lhtml.h -u -p -r1.52 -r1.53
--- html.h
+++ html.h
@@ -50,7 +50,6 @@ enum	htmltag {
 	TAG_I,
 	TAG_CODE,
 	TAG_SMALL,
-	TAG_EM,
 	TAG_MAX
 };
 
Index: html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.c,v
retrieving revision 1.162
retrieving revision 1.163
diff -Lhtml.c -Lhtml.c -u -p -r1.162 -r1.163
--- html.c
+++ html.c
@@ -74,7 +74,6 @@ static	const struct htmldata htmltags[TA
 	{"i",		0 }, /* TAG_I */
 	{"code",	0 }, /* TAG_CODE */
 	{"small",	0 }, /* TAG_SMALL */
-	{"em",		0 }, /* TAG_EM */
 };
 
 static	const char	*const htmlattrs[ATTR_MAX] = {
Index: mdoc_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v
retrieving revision 1.197
retrieving revision 1.198
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.197 -r1.198
--- mdoc_html.c
+++ mdoc_html.c
@@ -1083,8 +1083,10 @@ mdoc_ex_pre(MDOC_ARGS)
 static int
 mdoc_em_pre(MDOC_ARGS)
 {
+	struct htmlpair	tag;
 
-	print_otag(h, TAG_EM, 0, NULL);
+	PAIR_CLASS_INIT(&tag, "emph");
+	print_otag(h, TAG_SPAN, 1, &tag);
 	return(1);
 }
 
@@ -1820,7 +1822,9 @@ mdoc_bf_pre(MDOC_ARGS)
 	else if (MDOC_BODY != n->type)
 		return(1);
 
-	if (FONT_Sy == n->norm->Bf.font)
+	if (FONT_Em == n->norm->Bf.font)
+		PAIR_CLASS_INIT(&tag[0], "emph");
+	else if (FONT_Sy == n->norm->Bf.font)
 		PAIR_CLASS_INIT(&tag[0], "symb");
 	else if (FONT_Li == n->norm->Bf.font)
 		PAIR_CLASS_INIT(&tag[0], "lit");
@@ -1838,8 +1842,6 @@ mdoc_bf_pre(MDOC_ARGS)
 	bufcat_su(h, "margin-left", &su);
 	PAIR_STYLE_INIT(&tag[1], h);
 	print_otag(h, TAG_DIV, 2, tag);
-	if (FONT_Em == n->norm->Bf.font)
-		print_otag(h, TAG_EM, 0, NULL);
 	return(1);
 }
 
Index: example.style.css
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/example.style.css,v
retrieving revision 1.50
retrieving revision 1.51
diff -Lexample.style.css -Lexample.style.css -u -p -r1.50 -r1.51
--- example.style.css
+++ example.style.css
@@ -30,7 +30,7 @@ div.mandoc .list		{ } /* All Bl. */
 div.mandoc i			{ } /* Italic: BI, IB, I, (implicit). */
 div.mandoc b			{ } /* Bold: SB, BI, IB, BR, RB, B, (implicit). */
 div.mandoc small		{ } /* Small: SB, SM. */
-div.mandoc em			{ font-style: italic; font-weight: normal; } /* Emphasis: Em, Bl -emphasis. */
+div.mandoc .emph		{ font-style: italic; font-weight: normal; } /* Emphasis: Em, Bl -emphasis. */
 div.mandoc .symb		{ font-style: normal; font-weight: bold; } /* Symbolic: Sy, Ms, Bf -symbolic. */
 div.mandoc .lit			{ font-style: normal; font-weight: normal; font-family: monospace; } /* Literal: Dl, Li, Ql, Bf -literal, Bl -literal, Bl -unfilled. */
 div.mandoc i.addr		{ font-weight: normal; } /* Address (Ad). */
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-14  0:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-14  0:31 mdocml: Revert previous, as requested by kristaps@ 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).