line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Markdown::Discount; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
335438
|
use 5.008000; |
|
5
|
|
|
|
|
50
|
|
4
|
5
|
|
|
5
|
|
26
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
156
|
|
5
|
5
|
|
|
5
|
|
27
|
use warnings; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
1508
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
12
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
13
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# This allows declaration use Text::Markdown::XS ':all'; |
16
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
17
|
|
|
|
|
|
|
# will save memory. |
18
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
19
|
|
|
|
|
|
|
markdown |
20
|
|
|
|
|
|
|
) ] ); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
our @EXPORT = qw( |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
require XSLoader; |
31
|
|
|
|
|
|
|
XSLoader::load('Text::Markdown::Discount', $VERSION); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new { |
34
|
14
|
|
|
14
|
0
|
758
|
return bless {}, 'Text::Markdown::Discount'; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub markdown { |
38
|
26
|
|
|
26
|
0
|
5953
|
my ($self, $text, $flags) = @_; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# Detect functional mode, and create an instance for this run.. |
41
|
26
|
100
|
|
|
|
72
|
unless (ref $self) { |
42
|
13
|
50
|
|
|
|
37
|
if ( $self ne __PACKAGE__ ) { |
43
|
13
|
|
|
|
|
44
|
my $ob = __PACKAGE__->new(); |
44
|
|
|
|
|
|
|
# $self is text, $text is options |
45
|
13
|
|
|
|
|
40
|
return $ob->markdown($self, $text, $flags); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
else { |
48
|
0
|
|
|
|
|
0
|
croak('Calling ' . $self . '->markdown (as a class method) is not supported.'); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
13
|
100
|
|
|
|
31
|
if (not defined $flags) { |
52
|
12
|
|
|
|
|
37
|
$flags = MKD_NOHEADER()|MKD_NOPANTS(); |
53
|
|
|
|
|
|
|
} |
54
|
13
|
|
|
|
|
320
|
return _markdown($text, $flags); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
__END__ |