File: formats.t

package info (click to toggle)
libpod-markdown-perl 3.101000-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 444 kB
  • sloc: perl: 1,000; makefile: 2
file content (160 lines) | stat: -rw-r--r-- 1,776 bytes parent folder | download | duplicates (5)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# vim: set ts=2 sts=2 sw=2 expandtab smarttab:
use strict;
use warnings;
use lib 't/lib';
use MarkdownTests;

convert_ok(
  <<'POD',
Some I<pod>

=for html <b>html</b>

=for markdown **mkdn**

=for something_else `ignored`
POD
  <<'MKDN',
Some _pod_
MKDN
  'disable html and markdown targets',
  init => sub { $_[0]->unaccept_targets(qw(markdown html)) },
);


convert_ok(
  <<'POD',
Some I<pod>

=for other no

=for html foo

=for :html bar

=for :other nope

=for markdown baz

=for :markdown qux
POD
  <<'MKDN',
Some _pod_

<div>
    foo
</div>

bar

baz

qux
MKDN
  'by default accept html and markdown targets',
);


convert_ok(
  <<'POD',
Some I<pod>

=for markdown **BOLD**! B<not pod>
POD
  <<'MKDN',
Some _pod_

**BOLD**! B<not pod>
MKDN
  '=for markdown passed through',
);


convert_ok(
  <<'POD',
Some I<pod>

=begin markdown

**BOLD**! B<not pod>

=end markdown
POD
  <<'MKDN',
Some _pod_

**BOLD**! B<not pod>
MKDN
  '=begin/end markdown passed through',
);


convert_ok(
  <<'POD',
Some I<pod>

=for :markdown **BOLD**! B<real bold>

=for :other `ignored`
POD
  <<'MKDN',
Some _pod_

\*\*BOLD\*\*! **real bold**
MKDN
  '=for :markdown gets processed and escaped',
);


convert_ok(
  <<'POD',
Some I<pod>

=begin :markdown

**BOLD**! B<real bold>

=end :markdown
POD
  <<'MKDN',
Some _pod_

\*\*BOLD\*\*! **real bold**
MKDN
  '=begin/end :markdown gets processed and escaped',
);


convert_ok(
  <<'POD',
Some I<pod>

=for html <i>not</i> I<pod> *text*
POD
  <<'MKDN',
Some _pod_

<div>
    <i>not</i> I<pod> *text*
</div>
MKDN
  '=for html passes through',
);


convert_ok(
  <<'POD',
Some I<pod>

=for :html <i>yes</i> I<pod> *text*
POD
  <<'MKDN',
Some _pod_

&lt;i>yes&lt;/i> _pod_ \*text\*
MKDN
  '=for :html gets processed and escaped',
);


done_testing;