Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Text::MultiMarkdown CPAN module

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


    Text::Markdown - Convert Markdown syntax to (X)HTML

        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 );

    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 <div> and <table> as well).

    This module implements the 'original' Markdown markdown syntax from:

    Text::Markdown supports a number of options to it's processor which
    control the behaviour of the output document.

    These options can be supplied to the constructor, on in a hash with the
    individual calls to the markdown method. See the synopsis for examples
    of both of the above styles.

    The options for the processor are:

    empty element suffix
        This option can be used to generate normal HTML output. By default,
        it is ' />', which is xHTML, change to '>' for normal HTML.

        Controls indent width in the generated markup, defaults to 4

        Controls if Markdown is processed when inside HTML blocks. Defaults
        to 0.

    A simple constructor, see the SYNTAX and OPTIONS sections for more

    The main function as far as the outside world is concerned. See the
    SYNOPSIS for details on use.

    Returns a reference to a hash with the key being the markdown reference
    and the value being the URL.

    Useful for building scripts which preprocess a list of links before the
    main content. See t/05options.t for an example of this hashref being
    passed back into the markdown method to create links.

    Markdown has been re-implemented in a number of languages, and with a
    number of additions.

    Those that I have found are listed below:

    C - <>
        Discount - Original Markdown, but in C. Fastest implementation
        available, and passes MDTest. Adds it's own set of custom features.

    python - <>
        Python Markdown which is mostly compatible with the original, with
        an interesting extension API.

    ruby (maruku) - <>
        One of the nicest implementations out there. Builds a parse tree
        internally so very flexible.

    php - <>
        A direct port of, also has a separately maintained
        'extra' version, which adds a number of features that were borrowed
        by MultiMarkdown.

    lua - <>
        Port to lua. Simple and lightweight (as lua is).

    haskell - <>
        Pandoc is a more general library, supporting Markdown,
        reStructuredText, LaTeX and more.

    javascript - <>
        Direct(ish) port of to JavaScript

    To file bug reports or feature requests please send email to:
    Please include with your report: (1) the example input; (2) the output
    you expected; (3) the output Markdown actually produced.

    See the Changes file for detailed release notes for this version.

        John Gruber

        PHP port and other contributions by Michel Fortin

        MultiMarkdown changes by Fletcher Penney

        CPAN Module Text::MultiMarkdown (based on Text::Markdown by Sebastian
        Riedel) originally by Darren Kulp (
        This module is maintained by: Tomas Doran

    Please note that this distribution is a fork of John Gruber's original
    Markdown project, and it *is not* in any way blessed by him.

    Whilst this code aims to be compatible with the original
    (and incorporates and passes the Markdown test suite) whilst fixing a
    number of bugs in the original - there may be differences between the
    behaviour of this module and If you find any differences
    where you believe Text::Markdown behaves contrary to the Markdown spec,
    please report them as bugs.

    Text::Markdown *does not* extend the markdown dialect in any way from
    that which is documented at daringfireball. If you want additional
    features, you should look at Text::MultiMarkdown.

    Original Code Copyright (c) 2003-2004 John Gruber
    <> All rights reserved.

    MultiMarkdown changes Copyright (c) 2005-2006 Fletcher T. Penney
    <> All rights reserved.

    Text::MultiMarkdown changes Copyright (c) 2006-2008 Darren Kulp
    <> and Tomas Doran <>

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are

    * Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

    * Neither the name "Markdown" nor the names of its contributors may be
    used to endorse or promote products derived from this software without
    specific prior written permission.

    This software is provided by the copyright holders and contributors "as
    is" and any express or implied warranties, including, but not limited
    to, the implied warranties of merchantability and fitness for a
    particular purpose are disclaimed. In no event shall the copyright owner
    or contributors be liable for any direct, indirect, incidental, special,
    exemplary, or consequential damages (including, but not limited to,
    procurement of substitute goods or services; loss of use, data, or
    profits; or business interruption) however caused and on any theory of
    liability, whether in contract, strict liability, or tort (including
    negligence or otherwise) arising in any way out of the use of this
    software, even if advised of the possibility of such damage.

Something went wrong with that request. Please try again.