Zubrikhin Alexey
10 years ago
1 changed files with 33 additions and 0 deletions
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env perl |
||||
|
||||
use strict; |
||||
use warnings; |
||||
use utf8; |
||||
|
||||
use Test::More tests => 3; |
||||
use Text::Dokuwiki; |
||||
|
||||
|
||||
my $dw = Text::Dokuwiki->new; |
||||
isa_ok($dw, 'Text::Dokuwiki'); |
||||
|
||||
|
||||
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 ', |
||||
[span => {'font-style' =>'italic'}, |
||||
'inline ', |
||||
[span => {'font-weight' => 'bold'}, |
||||
'formatting', |
||||
], |
||||
], |
||||
' rules ', |
||||
[a => {href => 'http://site.com'}, |
||||
'and', |
||||
], |
||||
' links.', |
||||
]); |
||||
|
||||
exit 0; |
Loading…
Reference in new issue