summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-08-14 00:29:13 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-08-14 00:29:13 +0000
commit30848b6d903aafa51081033429b2e38f56d46cc2 (patch)
treeaf131cb16e68cd2df063b12ad84b1163249f066d /usr.bin/mandoc/mdoc_html.c
parent67b56431764832e52898fdf28e2ba296a416c3aa (diff)
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...
Diffstat (limited to 'usr.bin/mandoc/mdoc_html.c')
-rw-r--r--usr.bin/mandoc/mdoc_html.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index 6e754e07f24..bad18727622 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.79 2014/08/13 15:19:24 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.80 2014/08/14 00:29:12 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -1081,8 +1081,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);
}
@@ -1818,7 +1820,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");
@@ -1836,8 +1840,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);
}