logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Author

       Masayoshi Sekimura, <sekimura@cpan.org>

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
       <http://daringfireball.net/projects/downloads/MarkdownTest_1.0.zip>

       The interface of the markdown() function in this module is not compatible with the markdown() function in
       Text::Markdown.

   EXPORTmarkdown 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

Name

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

See Also

       There are other modules on CPAN for converting Markdown:

       •   Text::Markdown is a pure-perl markdown converter.

       •   Markdent is a toolkit for parsing markdown, which can also be used to convert markdown to HTML.

       •   Text::Markup is a converter than can handle a number of input formats, including markdown.

       •   Text::MultiMarkdown converts MultiMarkdown (a superset of the original markdown format) to HTML.

       Additional markdown resources:

       •   Discount <http://www.pell.portland.or.us/~orc/Code/markdown/> - David  Loren  Parsons's  library  for
           converting markdown, written in C.

       •   Markdown   definition   <http://daringfireball.net/projects/markdown/>   -   John  Gruber's  original
           definition of the markdown format.

       •   Markdown   testsuite   <http://daringfireball.net/projects/downloads/MarkdownTest_1.0.zip>   -   John
           Gruber's testsuite for markdown.

       •   Markdown modules <http://neilb.org/reviews/markdown.html> - a review of all Perl modules for handling
           markdown, written by Neil Bowers.

Synopsis

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

See Also