You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
527 B

#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Test::More tests => 3;
10 years ago
use Text::Dokuwiki::Parser;
10 years ago
my $dw = Text::Dokuwiki::Parser->new;
isa_ok($dw, 'Text::Dokuwiki::Parser');
my $text = "This is text with //inline **formatting**// rules [[http://site.com|and]] links.";
my $tree = [ $dw->_parse_text($text) ];
is(ref $tree, 'ARRAY');
is_deeply($tree, [
'This is text with ',
10 years ago
[i => {}, 'inline ', [b => {}, 'formatting']],
' rules ',
10 years ago
[a => {href => 'http://site.com'}, 'and'],
' links.',
]);
exit 0;