Incorrect Mixing of HTML and Paragraphs (<p>)?


#1

I couldn’t get Dignus permalink to work here so excuse me for pasting this code.
Input:

This paragraph closes right after an opening span:
<span itemprop="contentLocation" itemscope itemtype="https://schema.org/City">
  <meta itemprop="name" content="Сухой Лог">
  <span itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
    <meta itemprop="addressCountry" content="RU">
    <span itemprop="addressLocality">г.Сухой Лог</span>,
    <span itemprop="addressRegion">Свердловская обл.</span>
    <meta itemprop="postalCode" content="624800">
  </span>
</span>

Dingus output:

<p>This paragraph closes right after an opening span:
<span itemprop="contentLocation" itemscope itemtype="https://schema.org/City"></p>
  <meta itemprop="name" content="Сухой Лог">
  <span itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
    <meta itemprop="addressCountry" content="RU">
    <span itemprop="addressLocality">г.Сухой Лог</span>,
    <span itemprop="addressRegion">Свердловская обл.</span>
    <meta itemprop="postalCode" content="624800">
  </span>
</span>

Is this output correct or buggy?


#2

In HTML5, meta tags are only allowed in the head element (and p tags are
not allowed there), so what you’re doing here is quite strange.

Anyway, this accords with the spec (sec. 4.6): commonmark treats the
line with the meta tag as starting a type-6 HTML block, so the preceding
paragraph is closed.

“Ilya Ig. Petrov” noreply@talk.commonmark.org writes:


#3

<meta> tags are used in semantic markup (microdata), it’s in the examples of Schema.org.
Also my page with <meta> microdata markup passes validator.w3.org just fine.

If non-header <meta> tags conform to the standards, then should behavior of common mark be changed to treat <meta> tags differently?


#4

“Ilya Ig. Petrov” noreply@talk.commonmark.org
writes:

<meta> tags are used in semantic markup
(microdata), it’s in the examples of Schema.org.
Also my page with <meta> microdata markup passes
validator.w3.org just fine.

If non-header <meta> tags conform to the standards,
then should behavior of common mark be changed to
treat <meta> tags differently?

As I read the HTML5 spec
https://www.w3.org/TR/html/document-metadata.html#the-meta-element
it says that meta elements are allowed only in a head
element, with the following exception: if the name
attribute is present, they are allowed “where metadata
content is expected.” (There is a link there, but it’s
a bit vague about what “where metadata content is
expected” means.)

In any case, the example from schema.org that you
link to doesn’t have a name element. Instead, it has
itemprop. The HTML5 spec for meta says:
“Exactly one of the name, http-equiv, and charset
attributes must be specified.” So, I guess this is not
valid HTML5. It might be valid HTML4.

We want to be pragmatic about this, so if this use of
meta tags is common, we should probably exclude the
meta tag from the list of tags in #6 of section 4.6 of
the spec, allowing them to appear as inline content.
Would anyone have objections to this?

Putting up an issue on the github tracker for the
spec would help ensure this isn’t forgotten.


#5