Fenced divs are containers for sequences of blocks, to which an attribute can be attached. A fenced div begins with an opening fence: a line with three or more consecutive `:` characters, followed by an attribute specifier, followed by optional whitespace and the end of the line. It ends with a closing fence: a line beginning with at least as many consecutive `:` characters as in the opening fence, followed by optional whitespace and the end of the line. If the end of the input (or enclosing block) is encountered before a closing fence, the fenced div is implicitly closed. ```````````````````````````````` example ::: {#bar .foo} Hi > A block quote. ::: .

Hi

A block quote.

```````````````````````````````` ```````````````````````````````` example :::: {#bar .foo} Hi > A block quote. ::::::::::::::::::::::::: .

Hi

A block quote.

```````````````````````````````` Fenced divs may be nested. ```````````````````````````````` example ::: {#bar .foo} Hi ::: {.baz} > A block quote. ::: ::: .

Hi

A block quote.

```````````````````````````````` A fenced div can interrupt a paragraph, without an intervening blank line. ```````````````````````````````` example Paragraph text ::: {#bar .foo} Hi ::: .

Paragraph text

Hi

```````````````````````````````` A fenced div *must* have attributes. ```````````````````````````````` example ::: Hi ::: .

::: Hi :::

```````````````````````````````` The closing fence must be at leats as long as the opening fence. ```````````````````````````````` example ::::: {.foo} Hi ::: :::::: .

Hi :::

```````````````````````````````` If the end of the input (or enclosing block) is encountered before a closing fence, the fenced div is implicitly closed. ```````````````````````````````` example > ::: {.foo} > Hi .

Hi

```````````````````````````````` Instead of a normal attribute specifier in curly braces, a single bare word may be used; it will be treated as a "class" attribute: ```````````````````````````````` example ::: c_d Hi ::: .

Hi

````````````````````````````````