markz
On this page

micromark-extension-directive

micromark-extension-directive (syntax, text) › should support an escaped colon which would otherwise be a directive

\:a

micromark-extension-directive (syntax, text) › should support a directive after an escaped colon

\::a

micromark-extension-directive (syntax, text) › should not support a directive after a colon

a ::b

micromark-extension-directive (syntax, text) › should not support a colon not followed by a letter

:

micromark-extension-directive (syntax, text) › should support a colon followed by a letter

:a

micromark-extension-directive (syntax, text) › should support a colon followed by a digit

:9

micromark-extension-directive (syntax, text) › should support a colon followed by non-ascii letters

a :פּלוטאָ b

micromark-extension-directive (syntax, text) › should not support a colon followed by a dash

:-

micromark-extension-directive (syntax, text) › should not support a colon followed by an underscore

:_

micromark-extension-directive (syntax, text) › should not support a colon followed by non-ascii punctuation

:꙳

micromark-extension-directive (syntax, text) › should support a digit in a name

:a9

micromark-extension-directive (syntax, text) › should support a dash in a name

:a-b

micromark-extension-directive (syntax, text) › should *not* support a dash at the end of a name

:a-

micromark-extension-directive (syntax, text) › should support an underscore in a name

:a_b

micromark-extension-directive (syntax, text) › should *not* support an underscore at the end of a name

:a_

micromark-extension-directive (syntax, text) › should *not* support a colon right after a name

:a:

micromark-extension-directive (syntax, text) › should not interfere w/ gemoji (1)

:+1:

micromark-extension-directive (syntax, text) › should not interfere w/ gemoji (2)

:heart:

micromark-extension-directive (syntax, text) › should not interfere w/ gemoji (3)

:call_me_hand:

micromark-extension-directive (syntax, text) › should not interfere w/ emphasis (_)

_:directive_

micromark-extension-directive (syntax, text) › should support a name followed by an unclosed [

:a[

micromark-extension-directive (syntax, text) › should support a name followed by an unclosed {

:a{

micromark-extension-directive (syntax, text) › should support a name followed by an unclosed [ w/ content

:a[b

micromark-extension-directive (syntax, text) › should support a name followed by an unclosed { w/ content

:a{b

micromark-extension-directive (syntax, text) › should support an empty label

:a[]

micromark-extension-directive (syntax, text) › should support a whitespace only label

:a[ →]

micromark-extension-directive (syntax, text) › should support an eol in a label

:a[
]

micromark-extension-directive (syntax, text) › should support content in a label

:a[a b c]asd

micromark-extension-directive (syntax, text) › should support markdown in a label

:a[a *b* c]asd

micromark-extension-directive (syntax, text) › should support initial and final whitespace in and around a label

a :x[ b ] c

micromark-extension-directive (syntax, text) › should support markdown in a label (hard break)

:x[a␣␣
b]c

micromark-extension-directive (syntax, text) › should support a directive in a label

a :b[c :d[e] f] g

micromark-extension-directive (syntax, text) › should support content after a label

:a[]asd

micromark-extension-directive (syntax, text) › should support empty attributes

:a{}

micromark-extension-directive (syntax, text) › should support whitespace only attributes

:a{ →}

micromark-extension-directive (syntax, text) › should support an eol in attributes

:a{
}

micromark-extension-directive (syntax, text) › should support attributes w/o values

:a{a b c}

micromark-extension-directive (syntax, text) › should support attributes w/ non-ascii letters

:planet{плутон}

micromark-extension-directive (syntax, text) › should support attributes w/ unquoted values

:a{a=b c=d}

micromark-extension-directive (syntax, text) › should support attributes w/ class shortcut

:a{.a .b}

micromark-extension-directive (syntax, text) › should support attributes w/ class shortcut w/o whitespace between

:a{.a.b}

micromark-extension-directive (syntax, text) › should support attributes w/ id shortcut

:a{#a #b}

micromark-extension-directive (syntax, text) › should support attributes w/ id shortcut w/o whitespace between

:a{#a#b}

micromark-extension-directive (syntax, text) › should support attributes w/ shortcuts combined w/ other attributes

:a{#a.b.c#d e f=g #h.i.j}

micromark-extension-directive (syntax, text) › should not support an empty shortcut (.)

:a{..b}

micromark-extension-directive (syntax, text) › should not support certain characters in shortcuts (=)

:a{.a=b}

micromark-extension-directive (syntax, text) › should support non-ascii characters in shortcuts

:a{#بلوتو}

micromark-extension-directive (syntax, text) › should support most characters in shortcuts

:a{.a💚b}

micromark-extension-directive (syntax, text) › should support an underscore in attribute names

:a{_}

micromark-extension-directive (syntax, text) › should support a colon in attribute names

:a{xml:lang}

micromark-extension-directive (syntax, text) › should support double quoted attributes

:a{a="b" c="d e f"}

micromark-extension-directive (syntax, text) › should support single quoted attributes

:a{a='b' c='d e f'}

micromark-extension-directive (syntax, text) › should support whitespace around initializers

:a{a = b c→=→'d' f  =␍"g"}

micromark-extension-directive (syntax, text) › should not support = to start an unquoted attribute value

:a{b==}

micromark-extension-directive (syntax, text) › should not support a missing attribute value after =

:a{b=}

micromark-extension-directive (syntax, text) › should not support an apostrophe in an unquoted attribute value

:a{b=c'}

micromark-extension-directive (syntax, text) › should not support a grave accent in an unquoted attribute value

:a{b=c`}

micromark-extension-directive (syntax, text) › should support most other characters in unquoted attribute values

:a{b=a💚b}

micromark-extension-directive (syntax, text) › should not support an EOF in a quoted attribute value

:a{b="c

micromark-extension-directive (syntax, text) › should support most other characters in quoted attribute values

:a{b="a💚b"}

micromark-extension-directive (syntax, text) › should support EOLs in quoted attribute values

:a{b="
c␍  d"}

micromark-extension-directive (syntax, text) › should not support an EOF after a quoted attribute value

:a{b="c"

micromark-extension-directive (syntax, leaf) › should support a directive

::b

micromark-extension-directive (syntax, leaf) › should not support two colons not followed by a letter

::

micromark-extension-directive (syntax, leaf) › should support two colons followed by a letter

::a

micromark-extension-directive (syntax, leaf) › should support two colons followed by a digit

::9

micromark-extension-directive (syntax, leaf) › should support two colons followed by non-ascii letters

::פּלוטאָ

micromark-extension-directive (syntax, leaf) › should not support two colons followed by a dash

::-

micromark-extension-directive (syntax, leaf) › should not support a name followed by an unclosed [

::a[

micromark-extension-directive (syntax, leaf) › should not support a name followed by an unclosed {

::a{

micromark-extension-directive (syntax, leaf) › should not support a name followed by an unclosed [ w/ content

::a[b

micromark-extension-directive (syntax, leaf) › should not support a name followed by an unclosed { w/ content

::a{b

micromark-extension-directive (syntax, leaf) › should not support an eol in a label

::a[
]

micromark-extension-directive (syntax, leaf) › should not support content after a label

::a[]asd

micromark-extension-directive (syntax, leaf) › should not support an eol in attributes

::a{
}

micromark-extension-directive (syntax, leaf) › should not support EOLs around initializers

::a{f  =␍g}

micromark-extension-directive (syntax, leaf) › should not support EOLs in quoted attribute values

::a{b="
c␍  d"}

micromark-extension-directive (syntax, leaf) › should support whitespace after directives

::a{b=c} →␣

micromark-extension-directive (syntax, leaf) › should support a block quote after a leaf

::a{b=c}
>a

micromark-extension-directive (syntax, leaf) › should support code (fenced) after a leaf

::a{b=c}
```js
a

micromark-extension-directive (syntax, leaf) › should support a heading (atx) after a leaf

::a{b=c}
# a

micromark-extension-directive (syntax, leaf) › should support a list after a leaf

::a{b=c}
* a

micromark-extension-directive (syntax, leaf) › should support a paragraph after a leaf

::a{b=c}
a

micromark-extension-directive (syntax, leaf) › should support a block quote before a leaf

>a
::a{b=c}

micromark-extension-directive (syntax, leaf) › should support code (fenced) before a leaf

```js
a
```
::a{b=c}

micromark-extension-directive (syntax, leaf) › should support a heading (atx) before a leaf

# a
::a{b=c}

micromark-extension-directive (syntax, leaf) › should support a list before a leaf

* a
::a{b=c}

micromark-extension-directive (syntax, leaf) › should support a paragraph before a leaf

a
::a{b=c}

micromark-extension-directive (syntax, leaf) › should not support lazyness (1)

> ::a
b

micromark-extension-directive (syntax, leaf) › should not support lazyness (2)

> a
::b

micromark-extension-directive (syntax, container) › should not support three colons not followed by a letter

:::

micromark-extension-directive (syntax, container) › should support three colons followed by a letter

:::a

micromark-extension-directive (syntax, container) › should support three colons followed by a digit

:::9

micromark-extension-directive (syntax, container) › should support three colons followed by non-ascii letters

:::פּלוטאָ

micromark-extension-directive (syntax, container) › should not support three colons followed by a dash

:::-

micromark-extension-directive (syntax, container) › should support no closing fence

:::a

micromark-extension-directive (syntax, container) › should support no closing fence in a block quote (1)

> :::directive

micromark-extension-directive (syntax, container) › should support no closing fence in a block quote (2)

> :::directive
>

micromark-extension-directive (syntax, container) › should support no closing fence in a block quote (3)

> :::directive
> asd

micromark-extension-directive (syntax, container) › should support no closing fence in a block quote (4)

> :::directive
>

asd

micromark-extension-directive (syntax, container) › should support no closing fence in a list (1)

* :::directive

micromark-extension-directive (syntax, container) › should support no closing fence in a list (2)

* :::directive
␣␣

micromark-extension-directive (syntax, container) › should support no closing fence in a list (3)

* :::directive
  asd

micromark-extension-directive (syntax, container) › should support no closing fence in a list (4)

* :::directive
␣␣

asd

micromark-extension-directive (syntax, container) › should support an immediate closing fence

:::a
:::

micromark-extension-directive (syntax, container) › should support content after a closing fence

:::a
:::
b

micromark-extension-directive (syntax, container) › should not close w/ a “closing” fence of two colons

:::a
::
b

micromark-extension-directive (syntax, container) › should close w/ a closing fence of more colons

:::a
::::
b

micromark-extension-directive (syntax, container) › should support more opening colons

::::a
::::
b

micromark-extension-directive (syntax, container) › should not close w/ a “closing” fence of less colons than the opening

:::::a
::::
b

micromark-extension-directive (syntax, container) › should close w/ a closing fence followed by white space

:::a
::: →
c

micromark-extension-directive (syntax, container) › should not close w/ a “closing” fence followed by other characters

:::a
::: b
c

micromark-extension-directive (syntax, container) › should close w/ an indented closing fence

:::a
  :::
c

micromark-extension-directive (syntax, container) › should not close w/ when the “closing” fence is indented at a tab size

:::a
→:::
c

micromark-extension-directive (syntax, container) › should not close w/ when the “closing” fence is indented more than a tab size

:::a
     :::
c

micromark-extension-directive (syntax, container) › should support blank lines in content

:::a

␣␣
→a

micromark-extension-directive (syntax, container) › should support an EOL EOF

:::a
→a

micromark-extension-directive (syntax, container) › should support an indented directive

  :::a
  b
  :::
c

micromark-extension-directive (syntax, container) › should still not close an indented directive when the “closing” fence is indented a tab size

  :::a
→:::
c

micromark-extension-directive (syntax, container) › should support a block quote after a container

:::a
:::
>a

micromark-extension-directive (syntax, container) › should support code (fenced) after a container

:::a
:::
```js
a

micromark-extension-directive (syntax, container) › should support a heading (atx) after a container

:::a
:::
# a

micromark-extension-directive (syntax, container) › should support a list after a container

:::a
:::
* a

micromark-extension-directive (syntax, container) › should support a paragraph after a container

:::a
:::
a

micromark-extension-directive (syntax, container) › should support a block quote before a container

>a
:::a
b

micromark-extension-directive (syntax, container) › should support code (fenced) before a container

```js
a
```
:::a
b

micromark-extension-directive (syntax, container) › should support a heading (atx) before a container

# a
:::a
b

micromark-extension-directive (syntax, container) › should support a list before a container

* a
:::a
b

micromark-extension-directive (syntax, container) › should support a paragraph before a container

a
:::a
b

micromark-extension-directive (syntax, container) › should support prefixed containers (1)

 :::x
␣

micromark-extension-directive (syntax, container) › should support prefixed containers (2)

 :::x
 - a

micromark-extension-directive (syntax, container) › should support prefixed containers (3)

 :::x
 - a
 > b

micromark-extension-directive (syntax, container) › should support prefixed containers (4)

 :::x
 - a
 > b
 :::

micromark-extension-directive (syntax, container) › should not support lazyness (3)

> a
:::b

micromark-extension-directive (syntax, container) › should not support lazyness (4)

> :::a
:::

micromark-extension-directive (compile) › should support a directives (abbr)

:abbr

:abbr[HTML]

:abbr{title="HyperText Markup Language"}

:abbr[HTML]{title="HyperText Markup Language"}

micromark-extension-directive (compile) › should support directives (youtube)

Text:

:youtube

:youtube[Cat in a box a]

:youtube{v=1}

:youtube[Cat in a box b]{v=2}

Leaf:

::youtube

::youtube[Cat in a box c]

::youtube{v=3}

::youtube[Cat in a box d]{v=4}

Container:

:::youtube
w
:::

:::youtube[Cat in a box e]
x
:::

:::youtube{v=5}
y
:::

:::youtube[Cat in a box f]{v=6}
z
:::

micromark-extension-directive (compile) › should support fall through directives (*)

:youtube[Cat in a box]
:br

content › should support character escapes and character references in label

:abbr[x\&y&z]

content › should support escaped brackets in a label

:abbr[x\[y\]z]

content › should support balanced brackets in a label

:abbr[x[y]z]

content › should support balanced brackets in a label, 32 levels deep

:abbr[1[2[3[4[5[6[7[8[9[10[11[12[13[14[15[16[17[18[19[20[21[22[23[24[25[26[27[28[29[30[31[32[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

content › should *not* support balanced brackets in a label, 33 levels deep

:abbr[1[2[3[4[5[6[7[8[9[10[11[12[13[14[15[16[17[18[19[20[21[22[23[24[25[26[27[28[29[30[31[32[33[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

content › should support character references in unquoted attribute values

:abbr{title=a'b}

content › should support character references in double attribute values

:abbr{title="a'b"}

content › should support unknown character references in attribute values

:abbr{title="a&somethingelse;b"}

content › should not support non-terminated character references in unquoted attribute values

:a{href=&param}

content › should not support non-terminated character references in double quoted attribute values

:a{href="&param"}

content › should support container directives in container directives

::::div{.big}
:::div{.small}
Text

content › should support leaf directives in container directives

:::div{.big}
::hr{.small}

content › should support text directives in container directives

:::div{.big}
:b[Text]

content › should support lists in container directives

:::section
* a
:::

content › should support lists w/ label brackets in container directives

:::section[]
* a
:::

content › should support lists w/ attribute braces in container directives

:::section{}
* a
:::

content › should support lazy containers in an unclosed container directive

:::i
- +
a

content › should support line endings + spread in containers (syntax-tree/mdast-util-directive#13)

 :::div
* b

 c
:::