line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## |
2
|
|
|
|
|
|
|
# name: WikiText::Socialtext |
3
|
|
|
|
|
|
|
# abstract: Socialtext WikiText Module |
4
|
|
|
|
|
|
|
# author: Ingy döt Net |
5
|
|
|
|
|
|
|
# license: perl |
6
|
|
|
|
|
|
|
# copyright: 2008, 2010, 2011 |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package WikiText::Socialtext; |
9
|
1
|
|
|
1
|
|
302169
|
use 5.008003; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
58
|
|
10
|
1
|
|
|
1
|
|
1008
|
use WikiText 0.15 (); |
|
1
|
|
|
|
|
374
|
|
|
1
|
|
|
|
|
28
|
|
11
|
1
|
|
|
1
|
|
7
|
use base 'WikiText'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
375
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.20'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub to_html { |
16
|
1
|
|
|
1
|
0
|
36
|
my $self = shift; |
17
|
1
|
|
|
|
|
5
|
my $parser_class = ref($self) . '::Parser'; |
18
|
1
|
50
|
|
|
|
94
|
eval "require $parser_class; 1" |
19
|
|
|
|
|
|
|
or die "Can't load $parser_class:\n$@"; |
20
|
1
|
|
|
|
|
928
|
require WikiText::HTML::Emitter; |
21
|
1
|
|
|
|
|
9551
|
my $parser = $parser_class->new( |
22
|
|
|
|
|
|
|
receiver => WikiText::HTML::Emitter->new(break_lines => 1), |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
44
|
return $parser->parse($self->{wikitext}); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 SYNOPSIS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
use WikiText::Socialtext; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $html = WikiText::Socialtext->new($wikitext)->to_html; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DESCRIPTION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
This module can convert Socialtext markup to HTML. |