Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Text::Markdown::Discount

Name Text::Markdown::Discount
Version 0.13
Located at /usr/lib/x86_64-linux-gnu/perl5/5.34
File /usr/lib/x86_64-linux-gnu/perl5/5.34/Text/Markdown/Discount.pm
Is Core No
Search CPAN for this module Text::Markdown::Discount
Documentation Text::Markdown::Discount
Module Details Text::Markdown::Discount

NAME

Text::Markdown::Discount - fast function for converting markdown to HTML (requires C compiler)


SYNOPSIS

  use Text::Markdown::Discount;
  my $html = markdown($text)


DESCRIPTION

Text::Markdown::Discount is a perl interface to the Discount library, a C implementation of John Gruber's markdown.

It is the fastest of the Perl modules available for converting markdown: see the list in 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 markdown() function in this module is not compatible with the markdown() function in the Text::Markdown manpage.

EXPORT

markdown is exported by default.

FUNCTION

Text::Markdown::Discount::with_html5_tags()
This function enables html5 block-level elements support. Text::Markdown::Discount::markdown() will handle these html5 tags as block elements: aside, footer, header, hgroup, nav, section, article.

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


SEE ALSO

There are other modules on CPAN for converting Markdown:

Additional markdown resources:

  • Discount - David Loren Parsons's library for converting markdown, written in C.

  • Markdown definition - John Gruber's original definition of the markdown format.

  • Markdown testsuite - John Gruber's testsuite for markdown.

  • Markdown modules - a review of all Perl modules for handling markdown, written by Neil Bowers.


AUTHOR

Masayoshi Sekimura, <sekimura@cpan.org>


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>

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026