NAME Text::Markdown - Convert Markdown syntax to (X)HTML SYNOPSIS use Text::Markdown 'markdown'; my $html = markdown($text); use Text::Markdown 'markdown'; my $html = markdown( $text, { empty_element_suffix => '>', tab_width => 2, } ); use Text::Markdown; my $m = Text::Markdown->new; my $html = $m->markdown($text); use Text::Markdown; my $m = Text::MultiMarkdown->new( empty_element_suffix => '>', tab_width => 2, ); my $html = $m->markdown( $text ); DESCRIPTION Markdown is a text-to-HTML filter; it translates an easy-to-read / easy-to-write structured text format into HTML. Markdown's text format is most similar to that of plain text email, and supports features such as headers, *emphasis*, code blocks, blockquotes, and links. Markdown's syntax is designed not as a generic markup language, but specifically to serve as a front-end to (X)HTML. You can use span-level HTML tags anywhere in a Markdown document, and you can use block level HTML tags (like
and as well). SYNTAX This module implements the 'original' Markdown markdown syntax from: http://daringfireball.net/projects/markdown/ Note that Text::Markdown ensures that the output always ends with one newline. The fact that multiple newlines are collapsed into one makes sense, because this is the behavior of HTML towards whispace. The fact that there's always a newline at the end makes sense again, given that the output will always be nested in a block-level element (as opposed to an inline element). That block element can be a "

" (most often), or a "

". Markdown is not interpreted in HTML block-level elements, in order for chunks of pasted HTML (e.g. JavaScript widgets, web counters) to not be magically (mis)interpreted. For selective processing of Markdown in some, but not other, HTML block elements, add a "markdown" attribute to the block element and set its value to 1, "on" or "yes":