simple reference link . [text *emphasis*](a){#id .a} .

text emphasis

. simple definition link . [a][]{#id .b} [a]: /url .

a

. simple image . ![a](b){#id .a b=c} .

a

. simple inline code . `a`{#id .a b=c} .

a

. ignore if space . ![a](b) {#id key="*"} .

a {#id key="*"}

. ignore if text . ![a](b)b{#id key="*"} .

ab{#id key="*"}

. multi-line . ![a](b){ #id .a b=c } more .

a more

. merging attributes . ![a](b){#a .a}{.b class=x other=h}{#x class="x g" other=a} .

a

. spans: simple . [a]{#id .b}c .

ac

. spans: end of inline before attrs . [a] .

[a]

. spans: space between brace and attrs . [a] {.b} .

[a] {.b}

. spans: escaped span start . \[a]{.b} .

[a]{.b}

. spans: escaped span end . [a\]{.b} .

[a]{.b}

. spans: escaped span attribute . [a]\{.b} .

[a]{.b}

. spans: nested text syntax . [*a*]{.b}c .

ac

. spans: nested span . *[a]{.b}c* .

ac

. spans: multi-line . x [a b]{#id b=c} y .

x a b y

. spans: nested spans . [[a]{.b}]{.c} .

a

. spans: short link takes precedence over span . [a]{#id .b} [a]: /url .

a

. spans: long link takes precedence over span . [a][a]{#id .b} [a]: /url .

a

. spans: link inside span . [[a]]{#id .b} [a]: /url .

a

. spans: merge attributes . [a]{#a .a}{#b .a .b other=c}{other=d} .

a

.