use strict; use warnings; use utf8; use Markdown::Perl; use Test2::V0; sub run { &Markdown::Perl::convert; } is(run('***'), "
\n", 'break1'); is(run(' - - -'), "
\n", 'break2'); is(run(' ___ __ '), "
\n", 'break3'); is(run('# test'), "

test

\n", 'atx_heading1'); is(run('#'), "

\n", 'atx_heading2'); is(run('## '), "

\n", 'atx_heading3'); is(run('#### ###'), "

\n", 'atx_heading4'); is(run('## other '), "

other

\n", 'atx_heading5'); is(run("abc\n===\n", use_setext_headings => 1), "

abc

\n", 'setext_heading1'); is(run("abc\ndef\n===\n", use_setext_headings => 1), "

abc\ndef

\n", 'setext_heading2'); is(run("abc\n---\n", use_setext_headings => 1), "

abc

\n", 'setext_heading3'); is(run(" abc\n===\n", use_setext_headings => 1), "

abc

\n", 'setext_heading4'); is(run("abc\n =\n", use_setext_headings => 1), "

abc

\n", 'setext_heading5'); is(run(' test'), "
test
\n", 'indented_code1'); is(run(" test\n next\n"), "
test\n  next\n
\n", 'indented_code2'); is(run("\t test\n\t next\n"), "
  test\n  next\n
\n", 'indented_code3'); is(run("```\ntest\n```"), "
test\n
\n", 'fenced_code1'); is(run(" ```\ntest\n other\n```"), "
test\n other\n
\n", 'fenced_code2'); is(run("~~~~\ntest\n~~~~"), "
test\n
\n", 'fenced_code3'); is(run("~~~~\ntest\n~~~\n~~~~"), "
test\n~~~\n
\n", 'fenced_code4'); is(run("```abc\ntest\n```"), "
test\n
\n", 'fenced_code5'); is(run("```abc def\ntest\n```"), "
test\n
\n", 'fenced_code6'); is(run("abc"), "

abc

\n", 'paragraph1'); is(run("abc\ndef"), "

abc\ndef

\n", 'paragraph2'); is(run("abc\n\ndef"), "

abc

\n

def

\n", 'paragraph3'); is(run("foo\r\nbar"), "

foo\nbar

\n", 'paragraph4'); is(run("
\nabc\n
\n"), "
\nabc\n
\n", 'html1'); is(run("
\nabc\n"), "
\nabc\n", 'html2');
is(run("

\nabc\n"), "

\nabc\n", 'html3'); is(run("

\nabc\n\ndef"), "

\nabc\n

def

\n", 'html4'); is(run("\n*abc*\n\ndef"), "\n*abc*\n

def

\n", 'html5'); done_testing;