use strict; use warnings; use utf8; use Markdown::Perl; use Test2::V0; sub run { &Markdown::Perl::convert; } is(run(":::\ncontent\n:::"), "
\n

content

\n
\n", 'naked block'); is(run("::: block\ncontent\n:::"), "
\n

content

\n
\n", 'block with name'); is(run("::: {#block}\ncontent\n:::"), "
\n

content

\n
\n", 'block with id'); is(run("::: {.Block}\ncontent\n:::"), "
\n

content

\n
\n", 'block with class'); is(run("::: {.block .other}\ncontent\n:::"), "
\n

content

\n
\n", 'block with classes'); is(run("::: {key=value}\ncontent\n:::"), "
\n

content

\n
\n", 'block with data'); is(run("::: name {.block #id .other}\ncontent\n:::"), "
\n

content

\n
\n", 'block with name, id, and classes'); is(run(":::: B1\n::: B2\ncontent\n:::\nrest\n::::\nend\n"), "
\n
\n

content

\n
\n

rest

\n
\n

end

\n", 'nested blocks'); like(warning { run("::: {#junk=junk}\n:::") }, qr/Unused attribute content/, 'warn for junk attribute'); like(warning { run("::: [content]\n:::") }, qr/Unused inline content/, 'warn for inline content'); is(run(":::\ncontent\n:::", use_directive_blocks => 0), "

:::\ncontent\n:::

\n", 'disable block directives'); is(run(":::::::: SPOILERS ::::::::\ncontent\n::::::::::::::::::::::::::"), "
\n

content

\n
\n", 'fancy block'); done_testing;