bracketed-span

24 cases. Source: tests/bracketed-span.json.

#1 canonical

Source

[Beta]{.badge tone=warn}

Rendered

Beta

Downgrade

Beta

#2 inline content inside the span

Source

A [badge *x* `y`]{.small} b

Rendered

A badge x y b

Downgrade

A badge *x* `y` b

#3 id and reserved classes

Source

[Beta]{#rel .badge .warn}

Rendered

Beta

Downgrade

Beta

#4 empty span

Source

[]{.x}

Rendered

Downgrade

(empty)

#5 nested spans

Source

[a [b]{.inner} c]{.outer}

Rendered

a b c

Downgrade

a b c

#6 nested brackets that are not a span are literal text

Source

[a [b] c]{.x}

Rendered

a [b] c

Downgrade

a \[b] c

#7 escaped closing bracket in the text

Source

[a \] b]{.x}

Rendered

a ] b

Downgrade

a ] b

#8 span text may span lines

Source

[one
two]{.x}

Rendered

one two

Downgrade

one
two

#9 closing brace inside a quoted value

Source

[x]{title="a}b"}

Rendered

x

Downgrade

x

#10 a quote inside a bare value does not start a quoted value

invalid

Source

[x]{k=a"b c=d}

Rendered

x

Downgrade

x

Diagnostics: ATTR_BAD_VALUE

#11 span next to a link

Source

[a]{.x}[b](u)

Rendered

ab

Downgrade

a[b](u)

#12 span inside link text

Source

[a [b]{.x}](u)

Rendered

a b

Downgrade

[a b](u)

#13 span in a heading

Source

# Title [Beta]{.badge}

Rendered

Title Beta

Downgrade

# Title Beta

#14 link is not a span

Source

[text](u)

Rendered

Downgrade

[text](u)

#15 brackets without a specifier are ordinary text

Source

[text] and [more] {.x}

Rendered

[text] and [more] {.x}

Downgrade

\[text] and \[more] {.x}

#16 space before the specifier is not a span

Source

[text] {.x}

Rendered

[text] {.x}

Downgrade

\[text] {.x}

#17 unterminated specifier is ordinary text

Source

[text]{.x and more

Rendered

[text]{.x and more

Downgrade

\[text]{.x and more

#18 specifier may not span lines

Source

[text]{.x
.y}

Rendered

[text]{.x .y}

Downgrade

\[text]{.x
.y}

#19 images take no attributes in v0

Source

![alt]{.x}

Rendered

![alt]{.x}

Downgrade

!\[alt]{.x}

#20 inline code is not a span

Source

`[a]{.x}`

Rendered

[a]{.x}

Downgrade

`[a]{.x}`

#21 attribute errors carry through

invalid

Source

[x]{#}

Rendered

x

Downgrade

x

Diagnostics: ATTR_BAD_IDENTIFIER

#22 reserved key in a span

invalid

Source

[x]{class=y}

Rendered

x

Downgrade

x

Diagnostics: ATTR_RESERVED_KEY

#23 two bad spans report twice

invalid

Source

[a]{=} [b]{=}

Rendered

a b

Downgrade

a b

Diagnostics: ATTR_UNEXPECTED_CHAR ATTR_UNEXPECTED_CHAR

#24 lead on a span warns

Source

[x]{.lead}

Rendered

x

Downgrade

x

Diagnostics: CLASS_MISAPPLIED