aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-08-14 00:31:43 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-08-14 00:31:43 +0000
commit3b9ecd40b6ed9cef16a4ce87cfc12713cd7c97e9 (patch)
treed639fc4ebeb49b6248f31790a827858216e0562b /mdoc_html.c
parent438eebf7ec01fbc8167f69287d4b4ab43d49e8d8 (diff)
downloadmandoc-3b9ecd40b6ed9cef16a4ce87cfc12713cd7c97e9.tar.gz
mandoc-3b9ecd40b6ed9cef16a4ce87cfc12713cd7c97e9.tar.zst
mandoc-3b9ecd40b6ed9cef16a4ce87cfc12713cd7c97e9.zip
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 'mdoc_html.c')
-rw-r--r--mdoc_html.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index a94d0c01..0dc32208 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.197 2014/08/13 15:25:22 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.198 2014/08/14 00:31:43 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);
}