NAME

Text::MarkMoreDown - Convert MarkMoreDown syntax to HTML

SYNOPSIS

use Text::MarkMoreDown 'markmod';
my $html = markmod($text);

use Text::MarkMoreDown 'markmod';
my $html = markmod( $text, {
    empty_element_suffix => '>',
    tab_width => 2,
} );

use Text::MarkMoreDown;
my $m = Text::MarkMoreDown->new;
my $html = $m->markdown($text);

use Text::MarkMoreDown;
my $m = Text::MarkMoreDown->new(
    empty_element_suffix => '>',
    tab_width => 2,
);
my $html = $m->markdown( $text );

DESCRIPTION

MarkMoreDown is a free MIT-licensed Ruby library for parsing and converting a superset of Markdown. It is supports standard Markdown (with some minor modifications) and various extensions that have inspired by PHP Markdown Extra, MultiMarkdown, kramdown and etc.

SYNTAX

Headings

Headings from h1 through h6 are constructed with a # for each level:

# h1 Heading
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading

<h1>h1 Heading</h1>
<h2>h2 Heading</h2>
<h3>h3 Heading</h3>
<h4>h4 Heading</h4>
<h5>h5 Heading</h5>
<h6>h6 Heading</h6>

Alternatively, for H1 and H2, an underline-ish style:

Alt-H1
======

Alt-H2
------

<h1>Alt-H1</h1>
<h2>Alt-H2</h2>

difference to standard markdown

optional labels

## h2 #:head-label
#### h4 ######## :my-label

<h2 id="head-label">h2</h2>
<h4 id="my-label">h4</h4>

Alt-h1
====== :my-label

<h1 id="my-label">Alt-H1</h1>

Horizontal Rules

A horizontal rule for visually separating content is created by using three or more asterisks, dashes or underscores (these may not be mixed on a line), optionally separated by spaces, on an otherwise blank line. The first asterisk, dash or underscore may optionally be indented up to three spaces.

***
---
___
* * * * * * * * *
--------
______________


<hr>

Paragraphs and Line Breaks

paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line — a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs.

The implication of the “one or more consecutive lines of text” rule is that Markdown supports “hard-wrapped” text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type’s “Convert Line Breaks” option) which translate every line break character in a paragraph into a <br> tag.

When you do want to insert a <br> break tag using Markdown, you end a line with two or more spaces, then type return.

Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus.
Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum
inermis inimicus efficiendi.⋅⋅
Labore officiis his ex, soluta officiis
concludaturque ei qui, vide sensibus vim ad.

<p>
Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi.
<br>
Labore officiis his ex, soluta officiisconcludaturque ei qui, vide sensibus vim ad.
</p>

difference to standard markdown

>> Attribute List Definitions

{= .class #id style="..." dir="..." align="..." .... }

Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus.
Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum
inermis inimicus efficiendi.⋅⋅
Labore officiis his ex, soluta officiis
concludaturque ei qui, vide sensibus vim ad.
{= .class #entry .more align="center" #body width="200px" }

<p class="class more" id="entry body" align="left" width="200px">
Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi.
<br>
Labore officiis his ex, soluta officiisconcludaturque ei qui, vide sensibus vim ad.
</p>

Emphasis

Bold

For emphasizing a snippet of text with a heavier font-weight.

The following snippet of text is rendered as bold text.

**rendered as bold text**

<strong>rendered as bold text</strong>

<strong>rendered as bold text</strong>

Italics

For emphasizing a snippet of text with italics.

_rendered as italicized text_

<em>rendered as italicized text</em>

<em>rendered as italicized text</em>

Mark

mark element defines ==marked== or ==highlighted== text

mark element defines <mar>marked</mark> or <mark>highlighted</mark> text

mark element defines <mar>marked</mark> or <mark>highlighted</mark> text

Inserted text

ins element defines ++inserted++ (added) text.

ins element defines <ins>inserted</ins> (added) text.

ins element defines <ins>inserted</ins> (added) text.

Small

small element defines --smaller-- text

small element defines <small>smaller</small> text

small element defines <small>smaller</small> text

strikethrough, deleted text

~~Strike through this text.~~

<del>Strike through this text.</del>

<del>Strike through this text.</del>

Deleted/Inserted Text

~~this is incorrect ~> this is correct~~

<del>this is incorrect</del> <ins>this is correct</ins>

<del>this is incorrect</del> <ins>this is correct</ins>

one space before and after ~> is optional

Superscript text

x^y + z^

x<sup>y + z</sup>

x<sup>y + z</sup>

Subscript text

text~index~

text<sub>index</sub>

C~6~H~12~O~6~

C<sub>6</sub>H<sub>12</sub>O<sub>6</sub>

Lists

Markdown supports ordered (numbered) and unordered (bulleted) lists. Unordered Lists

Unordered lists use asterisks, pluses, and hyphens — interchangably — as list markers. + Lorem ipsum dolor sit amet + Consectetur adipiscing elit + Integer molestie lorem at massa + Facilisis in pretium nisl aliquet + Nulla volutpat aliquam velit - Phasellus iaculis neque * Purus sodales ultricies * Vestibulum laoreet porttitor sem - Ac tristique libero volutpat at + Faucibus porta lacus fringilla vel + Aenean sit amet erat nunc + Eget porttitor lorem
  • Lorem ipsum dolor sit amet
  • Consectetur adipiscing elit
  • Integer molestie lorem at massa
  • Facilisis in pretium nisl aliquet
  • Nulla volutpat aliquam velit
    • Phasellus iaculis neque
      • Purus sodales ultricies
      • Vestibulum laoreet porttitor sem
    • Ac tristique libero volutpat at
  • Faucibus porta lacus fringilla vel
  • Aenean sit amet erat nunc
  • Eget porttitor lorem
+ item - item * item Ordered Lists

A list of items in which the order of items does explicitly matter. 1. Lorem ipsum dolor sit amet 2. Consectetur adipiscing elit 1. item - unordered item - unordered item 2. item 3. item 3. Integer molestie lorem at massa 4. Facilisis in pretium nisl aliquet 5. Nulla volutpat aliquam velit 6. Faucibus porta lacus fringilla vel 7. Aenean sit amet erat nunc 8. Eget porttitor lorem Definition Lists

MarkMoreDown has support for definition lists using the same syntax used in PHP Markdown Extra. Specifically: Apple : Pomaceous fruit of plants of the genus Malus in the family Rosaceae. : An american computer company. Orange : The fruit of an evergreen tree of the genus Citrus. becomes:
Apple
Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
Orange
The fruit of an evergreen tree of the genus Citrus.
separator

If you want to have one list directly after another one (both with the same list type, i.e. ordered or unordered), you need to use an EOB marker to separate the two: * List one ^ * List two BlockQuotes

you can set the attributes on certain elements using an attribute block. put the special attribute block {} immediately after the parenthesis or brackets containing the address. This is [an example][id]{.class1 .class2 #id1 style="..." #id3 other-attributes} [This link](http://kiavash.one/){.class1 .class2 #id1 style="..." #id3 other-attributes} B wrong style="border: 1px; width: 150px" correct style="border:1px;width:150px" Images

Admittedly, it’s fairly difficult to devise a “natural” syntax for placing images into a plain text document format. Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: inline and reference. Inline Images

Inline image syntax looks like this: ![Alt text](/path/to/img.jpg) ![Alt text](/path/to/img.jpg "Optional title") Reference-style Image

Reference-style image syntax looks like this: ![Alt text][id] Where “id” is the name of a defined image reference. Image references are defined using syntax identical to link references: [id]: url/to/image "Optional title attribute" Image Attributes

you can set the attributes on certain elements using an attribute block. put the special attribute block {} immediately after the parenthesis or brackets containing the address. ![Alt text](/path/to/img.jpg){.class1 .class2 #id1 style="..." #id3 width="100px" height="100px"} ![Alt text][id]{.class1 .class2 #id1 style="border:2px;max-width:100%" #id3 other-attributes} B wrong style="border: 1px; width: 150px" correct style="border:1px;width:150px" Codes

Inline code

To indicate a span of code, wrap it with backtick quotes (`). Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example: Use the `printf()` function. will produce: Use the printf() function. Code Blocks

Pre-formatted code blocks are used for writing about programming or markup source code. Rather than forming normal paragraphs, the lines of a code block are interpreted literally. Markdown wraps a code block in both
 and 
tags.

To produce a code block in Markdown, simply indent every line of the block by
at least 4 spaces or 1 tab. For example, given this input:

    This is a normal paragraph:

        This is a code block.

Markdown will generate:

    

This is a normal paragraph:

This is a code block.
    
One level of indentation — 4 spaces or 1 tab — is removed from each line of the code block. For example, this: Here is an example of AppleScript: tell application "Foo" beep end tell will turn into:

Here is an example of AppleScript:

tell application "Foo"
        beep
        end tell
    
separator

you can separate code blocks with ^ code block1 code block1 ^ code block2 code block2 Block code "fences"

Use "fences" ``` to block in multiple lines of code. ``` codes... ``` or ``` perl code... code... code... ```

        code...
        code...
        code...
    
and ``` :class-name some codes... ```

    some codes...
    
Tables

| | Grouping || | First Header | Second Header | Third Header | | ------------ | :-----------: | -----------: | | Content | *Long Cell* || | Content | **Cell** | Cell | | New section | More | Data | OPTIONS

empty element suffix
This option can be used to generate normal HTML output. By default, it is '>', which is HTML, change to ' />' for xHTML. img_ids
Controls if tags generated have an id attribute. Defaults to true. Turn off for compatibility with the original markdown. heading_ids
Controls if tags generated have an id attribute. Defaults to true. Turn off for compatibility with the original markdown. tab_width
Controls indent width in the generated markup, defaults to 4 disable_tables
If true, this disables the MarkMoreDown table handling. disable_footnotes
If true, this disables the MarkMoreDown footnotes handling. disable_bibliography
If true, this disables the MarkMoreDown bibliography/citation handling. disable_definition_lists

METHODS

new

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

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

John Gruber http://daringfireball.net/ PHP port and other contributions by Michel Fortin http://michelf.com/ MultiMarkdown by Fletcher Penney http://fletcher.freeshell.org/ kramdown by Thomas Leitner http://kramdown.gettalong.org/ CPAN Module Text::MultiMarkdown by Tomas Doran http://www.bobtfish.net/ MarkMoreDown by Kiavash Mazi http://kiavash.one THIS DISTRIBUTION

Please note that this distribution is a fork of Fletcher Penny's MarkMoreDown project, and it *is not* in any way blessed by him. Whilst this code aims to be compatible with the original MarkMoreDown (and incorporates and passes the MarkMoreDown test suite) whilst fixing a number of bugs in the original - there may be differences between the behaviour of this module and MarkMoreDown. If you find any differences where you believe Text::MarkMoreDown behaves contrary to the MarkMoreDown spec, please report them as bugs. SOURCE CODE

You can find the source code repository for L and L on GitHub at . COPYRIGHT AND LICENSE

Original Code Copyright (c) 2003-2004 John Gruber All rights reserved. MultiMarkdown changes Copyright (c) 2005-2006 Fletcher T. Penney All rights reserved. Text::MarkMoreDown changes Copyright (c) 2018 Kiavash Mazi Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * 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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 101:

Non-ASCII character seen before =encoding in '—'. Assuming UTF-8