A fence could say more than its language, but only the language survived to the HTML — anything marking a fence for a later stage had to be an HTML comment next to it in the Markdown. The rest of the info string now lands on the code element as classes and data attributes, and all six places that render a code block finally agree on what one looks like.
The rest of a fence's info string becomes classes and data- attributes.
1.9.7 stopped meta words leaking into the language class, which fixed the
highlighting bug but threw the words away. So a fence could be labelled and
nothing downstream could see the label — the marker for "this block is a live
demo" had to live beside the fence as an HTML comment, one thing to keep in
sync with another.
Everything after the language now rides along: a bare word becomes a class, a
key=value token becomes a data attribute.
```html preview tab=options widths=375,768
<my-element></my-element>
```
<pre><code class="hljs language-html preview" data-tab="options" data-widths="375,768">…</code></pre>
A post-markup exec script then matches code.preview and reads the
settings off the element, with nothing in the Markdown but the fence itself.
Values are single tokens — no quotes, no spaces — which keeps the parser a
split; anything needing a sentence belongs in the prose around the fence,
not in its opening line.
A bare word is a class rather than a valueless attribute, since a class is
what the consumer selects on. When you do want the attribute — a flag read
with hasAttribute instead of off classList — write the key with nothing
after the =:
```html preview expanded=
<my-element></my-element>
```
<pre><code class="hljs language-html preview" data-expanded="">…</code></pre>
Backwards compatible in the strict sense: a single-token info string renders
exactly as before, which is every fence on every site today. Both the
{% highlight %} tag and the highlight filter take the
same info string.
language-html preview purely by accident. One
codeBlock helper now emits every code block, so there is one place left to
get wrong.