#!perl BEGIN { chdir 't' if -d 't' } use strict; use warnings; use Test::More tests => 8; use Test::NoWarnings; use Text::MediawikiFormat as => 'wikiformat', implicit_links => 1, process_html => 0; my $wikitext = " WikiTest code: foo bar baz "; my %format_tags = ( blocks => { code => qr/^code: / }, ); my $cooked = wikiformat( $wikitext, \%format_tags ); like $cooked, qr|
foo bar baz\n
|, 'unindented code markers should still work'; $wikitext = < qr/^(?:\t+|\s{4,}|\*?(?=\*+))/, blocks => { unordered => qr/^\s*\*+\s*/ }, nests => { unordered => 1 }, ); $cooked = wikiformat $wikitext, \%format_tags; like $cooked, qr/
  • foo/, 'first level of unordered list'; like $cooked, qr/