tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: Is there any reason not to use <EM> for items emphasized with .Em?
Date: Wed, 13 Aug 2014 19:20:48 +0200	[thread overview]
Message-ID: <20140813172048.GE26534@iris.usta.de> (raw)
In-Reply-To: <01237D5A-9F46-4047-83BF-A98CAB0C16E1@alum.mit.edu>

Hi,

Kristaps just pointed out that <em> accepts phrasing content only,
while .Bf may contain flow content like Bd Bf Bl D1 Pp Rs.
So my commit is incorrect:

ischwarze@isnote $ cd /usr/src/regress/usr.bin/mandoc/mdoc/Bf/ 
ischwarze@isnote $ mandoc -Thtml nest.in | validate            
*** Errors: ***
Error at line 30, character 73:  element "DIV" not allowed here; possible
        cause is an inline element containing a block-level element
Error at line 33, character 67:  element "DIV" not allowed here; possible
        cause is an inline element containing a block-level element

Ouch.

If <em> were a perfect match for .Em, and <strong> for .Sy, and
<code> for .Li, i'd tend to let mdoc_bf_pre() explicitly iterate
its children instead of relying on the loop in print_mdoc_node(),
close <em> before block children and reopen it afterwards, even
though that's a bit more complicated than what we have now.

But there is a second, slight problem:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em
exlicitly says:

  Usage Note: Typically this element is displayed in italic type.
  However, it should not be used simply to apply italic styling;
  use the CSS styling for that purpose.

Which is exactly what Kristaps' code did before my commit - and note
that i just argued myself, in my last mail, that .Em is physical,
not semantic markup, so this advice does indeed seem to apply.

Now we might revert the .Bf part only, maybe even only in those
cases where there actually *are* block children.  But that would
make .Bf output differ from .Em output, or even from other .Bf
output.  That doesn't seem nice, really, and it doesn't solve the
second problem.

So i tend to just revert the whole commit outright, solving both
problems completely and also avoiding code complication, and go
hide under a rock for the rest of the day.

Any thoughts?
  Ingo
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  parent reply	other threads:[~2014-08-13 17:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12 22:44 Guy Harris
2014-08-13  1:15 ` Ingo Schwarze
2014-08-13  2:06   ` Anthony J. Bentley
2014-08-13 14:51     ` Ingo Schwarze
2014-08-13 15:17       ` Anthony J. Bentley
2014-08-13 17:49         ` Ingo Schwarze
2014-08-13  1:44 ` Joerg Sonnenberger
2014-08-13 15:30   ` Ingo Schwarze
2014-08-13 17:20 ` Ingo Schwarze [this message]
2014-08-13 18:53   ` Guy Harris
2014-08-13 23:24   ` Kristaps Dzonsons
2014-08-14  0:46     ` Ingo Schwarze
  -- strict thread matches above, loose matches on Subject: below --
2012-12-21  0:30 Guy Harris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140813172048.GE26534@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).