metaformats-brainstorming: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(stub with which tag(s) and attributes to consider with some links)
(quote relevant sections from HTML spec)
Line 12: Line 12:


== Which attributes on meta ==
== Which attributes on meta ==
=== class ===
The meta tag does support the class attribute, but should we use it?
=== name ===
=== name ===
The HTML specification defines the meta name attribute: https://html.spec.whatwg.org/#attr-meta-name
The HTML specification defines the meta name attribute: https://html.spec.whatwg.org/#attr-meta-name
<blockquote>If a meta element has a name attribute, it sets document metadata.</blockquote>
This implies that absent a name attribute, a meta element does not set document metadata. Thus if microformats are to support parsing metadata from meta elements in a manner compatible with what HTML requires, microformats must use the <code>name</code> attribute.
<blockquote>Document metadata is expressed in terms of name-value pairs, the name attribute on the meta element giving the name …  The name specifies what aspect of metadata is being set; …</blockquote>
Since microformats has the similar model of name/value pairs in the form of properties and values, microformats should use the <code>name</code> attribute to express property semantics to follow this portion of the HTML specification.
As a fallback, should microformats also allow using the <code>class</code> attribute on meta tags? Or at least specify what should happen if it is present?


=== content ===
=== content ===
The HTML specification defines the meta content attribute: https://html.spec.whatwg.org/#attr-meta-content
The HTML specification defines the meta content attribute: https://html.spec.whatwg.org/#attr-meta-content
<blockquote>Document metadata is expressed in terms of name-value pairs, … the content attribute on the same element giving the value. … valid names and the meaning of their values are described in the following sections. If a meta element has no content attribute, then the value part of the metadata name-value pair is the empty string.</blockquote>


=== property ===
=== property ===

Revision as of 21:25, 1 April 2022

This page is for documenting brainstorming related to the metaformats.

Which HTML tags

See https://html.spec.whatwg.org/#metadata-content for tags to consider.

meta

The meta, obviously, for Open Graph Protocol and Twitter Cards at least. Are there any others?

  • Only in the head?
  • Or should we specify how to parse meta tags in the body as well?
    • Do any existing consuming code (that supports meta in the head) do anything with meta tags in the body?

Which attributes on meta

class

The meta tag does support the class attribute, but should we use it?

name

The HTML specification defines the meta name attribute: https://html.spec.whatwg.org/#attr-meta-name

If a meta element has a name attribute, it sets document metadata.

This implies that absent a name attribute, a meta element does not set document metadata. Thus if microformats are to support parsing metadata from meta elements in a manner compatible with what HTML requires, microformats must use the name attribute.

Document metadata is expressed in terms of name-value pairs, the name attribute on the meta element giving the name … The name specifies what aspect of metadata is being set; …

Since microformats has the similar model of name/value pairs in the form of properties and values, microformats should use the name attribute to express property semantics to follow this portion of the HTML specification.

As a fallback, should microformats also allow using the class attribute on meta tags? Or at least specify what should happen if it is present?

content

The HTML specification defines the meta content attribute: https://html.spec.whatwg.org/#attr-meta-content

Document metadata is expressed in terms of name-value pairs, … the content attribute on the same element giving the value. … valid names and the meaning of their values are described in the following sections. If a meta element has no content attribute, then the value part of the metadata name-value pair is the empty string.

property

Only for backcompat with Open Graph Protocol.

See Also