From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout-webserver.scc.kit.edu (mailout-webmail.scc.kit.edu [129.13.185.232]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s7D1G0G2012383 for ; Tue, 12 Aug 2014 21:16:01 -0400 (EDT) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by scc-mailout-02.scc.kit.edu with esmtp (Exim 4.72 #1) id 1XHNAP-0004Lr-14; Wed, 13 Aug 2014 03:15:53 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1XHNAO-0005pi-Sh; Wed, 13 Aug 2014 03:15:52 +0200 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1XHNAO-0003qU-Qe; Wed, 13 Aug 2014 03:15:52 +0200 Received: from schwarze by usta.de with local (Exim 4.77) (envelope-from ) id 1XHN9e-0008Lh-3l; Wed, 13 Aug 2014 03:15:06 +0200 Date: Wed, 13 Aug 2014 03:15:05 +0200 From: Ingo Schwarze To: Anthony Bentley , kristaps@bsd.lv Cc: tech@mdocml.bsd.lv, Guy Harris Subject: Re: Is there any reason not to use for items emphasized with .Em? Message-ID: <20140813011505.GA24152@iris.usta.de> References: <01237D5A-9F46-4047-83BF-A98CAB0C16E1@alum.mit.edu> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01237D5A-9F46-4047-83BF-A98CAB0C16E1@alum.mit.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Anthony and Kristaps, i think this is an improvement but feel like knowing too little about HTML to just go ahead and commit. Can either of you (or somebody else who feels at home with HTML) provide an OK? Thanks, Ingo Guy Harris wrote on Tue, Aug 12, 2014 at 03:44:07PM -0700: > .Em is documented in the groff_mdoc man page as > > Emphasis Macro > Text may be stressed or emphasized with the `.Em' macro. The usual font > for emphasis is italic. > > That sounds like the HTML tag - the HTML 4.01 spec says > > EM: > Indicates emphasis. > > ... > > The presentation of phrase elements depends on the user agent. Generally, visual user agents present EM text in italics and STRONG text in bold font. Speech synthesizer user agents may change the synthesis parameters, such as volume, pitch and rate accordingly. > > Is there any reason not to use that tag for text emphasized with .Em? > > If not, here's a patch: > > diff -Nup ../mdocml-1.13.1/example.style.css ./example.style.css > --- ../mdocml-1.13.1/example.style.css 2014-08-10 10:26:46.000000000 -0700 > +++ ./example.style.css 2014-08-12 14:04:22.000000000 -0700 > @@ -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 .emph { font-style: italic; font-weight: normal; } /* Emphasis: Em, Bl -emphasis. */ > +div.mandoc em { 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). */ > diff -Nup ../mdocml-1.13.1/html.c ./html.c > --- ../mdocml-1.13.1/html.c 2014-08-10 10:26:46.000000000 -0700 > +++ ./html.c 2014-08-12 14:04:22.000000000 -0700 > @@ -76,6 +76,7 @@ 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] = { > diff -Nup ../mdocml-1.13.1/html.h ./html.h > --- ../mdocml-1.13.1/html.h 2014-08-10 10:26:46.000000000 -0700 > +++ ./html.h 2014-08-12 14:04:22.000000000 -0700 > @@ -50,6 +50,7 @@ enum htmltag { > TAG_I, > TAG_CODE, > TAG_SMALL, > + TAG_EM, > TAG_MAX > }; > > diff -Nup ../mdocml-1.13.1/mdoc_html.c ./mdoc_html.c > --- ../mdocml-1.13.1/mdoc_html.c 2014-08-10 10:26:46.000000000 -0700 > +++ ./mdoc_html.c 2014-08-12 15:40:03.000000000 -0700 > @@ -1085,10 +1085,7 @@ mdoc_ex_pre(MDOC_ARGS) > static int > mdoc_em_pre(MDOC_ARGS) > { > - struct htmlpair tag; > - > - PAIR_CLASS_INIT(&tag, "emph"); > - print_otag(h, TAG_SPAN, 1, &tag); > + print_otag(h, TAG_EM, 0, NULL); > return(1); > } > > @@ -1824,9 +1821,7 @@ mdoc_bf_pre(MDOC_ARGS) > else if (MDOC_BODY != n->type) > return(1); > > - if (FONT_Em == n->norm->Bf.font) > - PAIR_CLASS_INIT(&tag[0], "emph"); > - else if (FONT_Sy == n->norm->Bf.font) > + 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"); > @@ -1844,6 +1839,10 @@ 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) { > + /* Tag this with . */ > + print_otag(h, TAG_EM, 0, NULL); > + } > return(1); > } > > diff -Nup ../mdocml-1.13.1/style.css ./style.css > --- ../mdocml-1.13.1/style.css 2014-08-10 10:26:46.000000000 -0700 > +++ ./style.css 2014-08-12 14:04:22.000000000 -0700 > @@ -34,7 +34,7 @@ td.head-rtitle { width: 10%; text-align: > /* General font modes. */ > > i { } /* Italic: BI, IB, I, (implicit). */ > -.emph { font-style: italic; font-weight: normal; } /* Emphasis: Em, Bl -emphasis. */ > +em { 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. */ > -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv