/usr/lib/perl5/Text/Markdown/Discount.pm is in libtext-markdown-discount-perl 0.11-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | package Text::Markdown::Discount;
use 5.008000;
use strict;
use warnings;
require Exporter;
our @ISA = qw(Exporter);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
# This allows declaration use Text::Markdown::XS ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
our %EXPORT_TAGS = ( 'all' => [ qw(
markdown
) ] );
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
our @EXPORT = qw(
);
our $VERSION = '0.11';
require XSLoader;
XSLoader::load('Text::Markdown::Discount', $VERSION);
sub new {
return bless {}, 'Text::Markdown::Discount';
}
sub markdown {
my ($self, $text, $flags) = @_;
# Detect functional mode, and create an instance for this run..
unless (ref $self) {
if ( $self ne __PACKAGE__ ) {
my $ob = __PACKAGE__->new();
# $self is text, $text is options
return $ob->markdown($self, $text, $flags);
}
else {
croak('Calling ' . $self . '->markdown (as a class method) is not supported.');
}
}
if (not defined $flags) {
$flags = MKD_NOHEADER()|MKD_NOPANTS();
}
return _markdown($text, $flags);
}
1;
__END__
# Below is stub documentation for your module. You'd better edit it!
=head1 NAME
Text::Markdown::Discount - fast function for converting markdown to HTML (requires C compiler)
=head1 SYNOPSIS
use Text::Markdown::Discount;
my $html = markdown($text)
=head1 DESCRIPTION
Text::Markdown::Discount is a perl interface to the C<Discount> library,
a C implementation of John Gruber's C<markdown>.
It is the fastest of the
Perl modules available for converting markdown: see the list in L<"SEE ALSO">.
It passes Gruber's Markdown testsuite.
Given that the performance of Discount, Text::Markdown::Discount processes
markdown formatted text quickly and passes the Markdown test suite at
The interface of the C<markdown()> function in this module
is not compatible with the C<markdown()> function in L<Text::Markdown>.
=head2 EXPORT
I<markdown> is exported by default.
=head2 FUNCTION
=over
=item C<Text::Markdown::Discount::with_html5_tags()>
This function enables html5 block-level elements support.
C<< Text::Markdown::Discount::markdown() >> will handle these html5 tags as
block elements: aside, footer, header, hgroup, nav, section, article.
B<NOTE>: There is no way to disable/re-enable this feature in one process right now.
use Text::Markdown::Discount;
Text::Markdown::Discount::with_html5_tags();
my $html = markdown('<article>content</article>');
#
# In $html, <article> tag won't be wrapped with <p> tag
=back
=head1 SEE ALSO
There are other modules on CPAN for converting Markdown:
=over 4
=item *
L<Text::Markdown> is a pure-perl markdown converter.
=item *
L<Markdent> is a toolkit for parsing markdown,
which can also be used to convert markdown to HTML.
=item *
L<Text::Markup> is a converter than can handle a number of input formats, including markdown.
=item *
L<Text::MultiMarkdown> converts MultiMarkdown (a superset of the original markdown format)
to HTML.
=back
Additional markdown resources:
=over 4
=item *
L<Discount|http://www.pell.portland.or.us/~orc/Code/markdown/> -
David Loren Parsons's library for converting markdown, written in C.
=item *
L<Markdown definition|http://daringfireball.net/projects/markdown/> -
John Gruber's original definition of the markdown format.
=item *
L<Markdown testsuite|http://daringfireball.net/projects/downloads/MarkdownTest_1.0.zip> -
John Gruber's testsuite for markdown.
=item *
L<Markdown modules|http://neilb.org/reviews/markdown.html> - a review
of all Perl modules for handling markdown, written by Neil Bowers.
=back
=head1 AUTHOR
Masayoshi Sekimura, E<lt>sekimura@cpan.orgE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2013 by Masayoshi Sekimura
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.0 or,
at your option, any later version of Perl 5 you may have available.
This product includes software developed by
David Loren Parsons <http://www.pell.portland.or.us/~orc>
=cut
|