Commit 9a4acc9e authored by Alessandro Ghedini's avatar Alessandro Ghedini

Imported Upstream version 0.10

parent 4e9e8aec
Makefile
Makefile.old
blib
Discount.bs
Discount.c
Discount.o
pm_to_blib
*.swp
discount/Csio.o
discount/basename.o
discount/blocktags
discount/cols
discount/config.cmd
discount/config.h
discount/config.log
discount/config.mak
discount/config.md
discount/config.sub
discount/css.o
discount/docheader.o
discount/dumptree.o
discount/echo
discount/emmatch.o
discount/flags.o
discount/generate.o
discount/github_flavoured.o
discount/html5.o
discount/libmarkdown
discount/libmarkdown.a
discount/librarian.sh
discount/main.o
discount/makepage
discount/markdown
discount/markdown.o
discount/mkd2html
discount/mkd2html.o
discount/mkdio.h
discount/mkdio.o
discount/mktags
discount/mktags.dSYM/
discount/pgm_options.o
discount/resource.o
discount/setup.o
discount/tags.o
discount/theme
discount/theme.o
discount/toc.o
discount/version.c
discount/version.o
discount/xml.o
discount/xmlpage.o
steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist, UploadCPAN
git.push_to = origin
Revision history for Perl extension Text::Markdown::XS.
0.10 Fri Aug 9 12:49:59 PDT 2013
- added with_html5_tags() to enable html5 block elements support (by @Songmu)
0.09 Mon Aug 5 10:08:05 PDT 2013
- fixed #14 "some files are missing in 0.08"
0.08 Sun Aug 4 23:50:18 PDT 2013
- Reverted html5 tags support
0.07 Sun Aug 4 18:44:48 PDT 2013
- Removed MYMETA (by @Songmu)
- Added html5 tags support (by @Songmu)
0.06 Sat Jul 13 20:35:10 PDT 2013
- Documentation improvements by @nailbowers
- fixed an issue with is_utf8 boolean casting behavior
......
......@@ -72,3 +72,8 @@ TextMarkdown__markdown(sv_str, flags)
RETVAL = r;
OUTPUT:
RETVAL
void
TextMarkdown_with_html5_tags()
CODE:
mkd_with_html5_tags();
.gitignore
Changes
Discount.xs
discount/amalloc.c
......@@ -21,11 +20,22 @@ discount/html5.c
discount/INSTALL
discount/main.c
discount/Makefile.in
discount/makepage.1
discount/makepage.c
discount/markdown.1
discount/markdown.3
discount/markdown.7
discount/markdown.c
discount/markdown.h
discount/mkd-callbacks.3
discount/mkd-extensions.7
discount/mkd-functions.3
discount/mkd-line.3
discount/mkd2html.1
discount/mkd2html.c
discount/mkdio.c
discount/mkdio.h.in
discount/mktags.c
discount/pgm_options.c
discount/pgm_options.h
discount/Plan9/markdown.1
......@@ -82,24 +92,27 @@ discount/tests/tables.t
discount/tests/tabstop.t
discount/tests/toc.t
discount/tests/xml.t
discount/theme.1
discount/theme.c
discount/toc.c
discount/tools/checkbits.sh
discount/tools/cols.c
discount/tools/echo.c
discount/VERSION
discount/version.c.in
discount/xml.c
discount/xmlpage.c
INSTALL.Discount
lib/Text/Markdown/Discount.pm
Makefile.PL
MANIFEST This list of files
MYMETA.json
MYMETA.yml
ppport.h
README
t/00.load.t
t/10.empty_or_all_newlines_input.t
t/11.flags.t
t/12.utf8.t
t/13.html5.t
xt/index.text
xt/MarkdownTest_1.0.3.t
xt/MarkdownTest_1.0.3/MarkdownTest.pl
......@@ -149,3 +162,4 @@ xt/MarkdownTest_1.0.3/Tests/Tidyness.html
xt/MarkdownTest_1.0.3/Tests/Tidyness.text
xt/MarkdownXS.pl
xt/test.pl
META.yml Module meta-data (added by MakeMaker)
\bRCS\b
\bCVS\b
\.svn/
\.git/
^MANIFEST\.
^Makefile$
~$
\.old$
^blib/
^pm_to_blib
^MakeMaker-\d
\.gz$
\.cvsignore
\.shipit
^discount/Csio.o
^discount/basename.o
^discount/blocktags
^discount/cols
^discount/config.cmd
^discount/config.h
^discount/config.log
^discount/config.mak
^discount/config.md
^discount/config.sub
^discount/css.o
^discount/docheader.o
^discount/dumptree.o
^discount/echo
^discount/emmatch.o
^discount/flags.o
^discount/generate.o
^discount/github_flavoured.o
^discount/html5.o
^discount/libmarkdown
^discount/libmarkdown.a
^discount/librarian.sh
^discount/main.o
^discount/makepage
^discount/markdown
^discount/markdown.o
^discount/mkd2html
^discount/mkd2html.o
^discount/mkdio.h
^discount/mkdio.o
^discount/mktags
^discount/mktags.dSYM/
^discount/pgm_options.o
^discount/resource.o
^discount/setup.o
^discount/tags.o
^discount/theme
^discount/theme.o
^discount/toc.o
^discount/theme
^discount/theme.o
^discount/toc.o
^discount/version.c
^discount/version.o
^discount/xml.o
^discount/xmlpage.o
--- #YAML:1.0
name: Text-Markdown-Discount
version: 0.10
abstract: fast function for converting markdown to HTML (requires C compiler)
author:
- Masayoshi Sekimura <sekimura@cpan.org>
license: unknown
distribution_type: module
configure_requires:
ExtUtils::MakeMaker: 0
build_requires:
ExtUtils::MakeMaker: 0
requires: {}
no_index:
directory:
- t
- inc
generated_by: ExtUtils::MakeMaker version 6.56
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
......@@ -25,7 +25,7 @@ our @EXPORT = qw(
);
our $VERSION = '0.06';
our $VERSION = '0.10';
require XSLoader;
XSLoader::load('Text::Markdown::Discount', $VERSION);
......@@ -87,6 +87,27 @@ is not compatible with the C<markdown()> function in L<Text::Markdown>.
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:
......@@ -145,7 +166,7 @@ Masayoshi Sekimura, E<lt>sekimura@cpan.orgE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2009 by Masayoshi Sekimura
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,
......
use strict;
use warnings;
use utf8;
use Test::More tests => 3;
use Text::Markdown::Discount qw/markdown/;
my $html = '<article>abc</article>';
{
is trim(markdown($html)), '<p><article>abc</article></p>';
}
Text::Markdown::Discount::with_html5_tags();
{
my $md = Text::Markdown::Discount->new();
is trim(markdown($html)), '<article>abc</article>';
}
{
is trim(Text::Markdown::Discount::markdown($html)), '<article>abc</article>';
}
sub trim {
my $text = shift;
$text =~ s/\A\s+//ms;
$text =~ s/\s+$//ms;
$text;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment