File: 30disable_multimarkdown_features.t

package info (click to toggle)
libtext-multimarkdown-perl 1.000035-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 1,772 kB
  • ctags: 148
  • sloc: perl: 2,186; makefile: 8
file content (40 lines) | stat: -rw-r--r-- 1,253 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use strict;
use warnings;
use Test::More tests => 4;

use_ok('Text::MultiMarkdown');

my $m = Text::MultiMarkdown->new(
    disable_tables => 1,
    disable_footnotes => 1,
    disable_bibliography => 1,
);

my $instr = q{Here is some text containing a footnote.[^somesamplefootnote]
    
[^somesamplefootnote]: Here is the text of the footnote itself};
my $expstr = q{<p>Here is some text containing a footnote.[^somesamplefootnote]</p>

<p>[^somesamplefootnote]: Here is the text of the footnote itself</p>
};

is($m->markdown($instr) => $expstr, 'disable_footnotes works as expected');

$instr = q{This is a borrowed idea[p. 23][#Doe:1996].
    
[#Doe:1996]:	John Doe. *Some Book*. Blog Books, 1996.
};

# NOTE expstr doesn't have the footnote, as that syntax is original markdown's link syntax, so
#      it is now resolved to a link
$expstr = qq{<p>This is a borrowed idea[p. 23][#Doe:1996].</p>\n};

is($m->markdown($instr) => $expstr, 'disable_bibliography works as expected');

$instr = q{------------ | :-----------: | -----------: |
Content       |          Long Cell           ||
Content       |   Cell    |             Cell |};

$expstr = '<p>' . $instr . "</p>\n";

is( $m->markdown($instr) => $expstr, 'disable_tables works as expected');