Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

cite

A machine-readable source URL for quotations and edits on blockquote, q, del and ins. Browsers never show it, so pair it with visible attribution.

Overview

The cite attribute gives the URL of the source a quotation came from, or of a document explaining an edit. Browsers do not display it and do not make it a link. It is there for tools that process the markup: scrapers, search engines, reading-mode and citation tools, and your own scripts.

This page is about the cite attribute. The <cite> element is different: it marks up the visible title of a work.

Applies to:

Values

ElementValuePoints to
<blockquote>, <q>A valid URLThe source of the quoted text
<del>, <ins>A valid URLA changelog entry, ticket or document explaining the change
Absent (the default) No source recorded

Relative URLs resolve against the document. The DOM properties (blockquote.cite, q.cite, del.cite, ins.cite) return the resolved absolute URL.

Examples

Inline quotation

<q> takes cite just like <blockquote>. Do not type quotation marks around it; the browser adds them.

Recording why an edit was made

On <del> and <ins>, pair cite with datetime for a full edit record.

Attribute or element?

 cite attribute<cite> element
HoldsA URLThe title of a work
VisibleNoYes (italic by default)
Used onblockquote, q, del, insAnywhere phrasing content is allowed
ForTools and scriptsReaders

In Vanilla Breeze

VB does not style or read the cite attribute. It styles the visible attribution that should go with it:

  • figure.quote (src/native-elements/figure/styles.css) is the preferred pattern. The <figcaption> sits outside the quotation, as the spec requires, and gets a "— " prefix that screen readers skip (content: "— " / "").
  • blockquote > footer and blockquote > cite (direct children only) get the same dash prefix (src/native-elements/blockquote/styles.css). This is kept for existing content; prefer figure.quote.
  • <q> gets locale-correct quotation marks from :lang() rules in src/native-elements/i18n/styles.css (“…” in English, „…“ in German, « … » in French).
  • <del> / <ins> accept VB's data-author, data-reason and data-announce annotations (src/native-elements/inline-semantics/styles.css); see the <del> page.
  • Untrusted HTML. VB's HTML sanitizer (src/lib/sanitize-html.js) and <card-list> field binding treat cite as a URL attribute and check its scheme, so a javascript: value is dropped.

Accessibility

  • Screen readers do not announce the cite attribute, and browsers do not expose it. It does nothing for readers on its own.
  • Always give visible attribution: a <figcaption> with the author, the work in <cite>, and a real link if the source is online.

Gotchas

  • No browser renders the URL, and users cannot reach it without viewing the source.
  • Browsers do not validate it. A typo goes unnoticed; an HTML validator will catch an invalid URL.
  • Attribution belongs outside the <blockquote>. A <footer> inside it makes the attribution part of the quotation.
  • Check quotes before you publish. Many popular quotations are misattributed; if you cannot find the original source, say "attributed to".

Related

Which to choose

  • cite attribute — always, when the source has a URL. It costs nothing and helps tools.
  • figure.quote + <figcaption> — the visible attribution for block quotations.
  • <cite> element — the title of the book, article or talk inside that caption.
↑