Parsedown PHP markdown parser

Parsedown is a pure-PHP Markdown parser (version 1.8.0) written by Emanuil Rusev. [https://parsedown.org/]

What it does

It takes Markdown-formatted text and converts it into HTML.

The main entry point is:

PHP
$Parsedown = new Parsedown();
$html = $Parsedown->text($markdown);

Core capabilities

It implements a full Markdown-to-HTML conversion pipeline that handles:

Block-level elements

Inline elements

Configuration options

The class exposes several setters:

Design notes

In short, this file is a complete, self-contained Markdown → HTML converter that you can drop into a PHP project.

Block-level elements

Syntax Description Example
ATXHeaders # to ###### # Heading 1
SetextHeaders Underlinewith = (h1)or - (h2) Heading
=======
UnorderedLists *, +,or - - item
OrderedLists 1. / 1) style(anystartingnumber) 1. item
NestedLists Indentedlistitems Supported
Blockquotes > > quoted text
IndentedCodeBlocks 4+spacesor1tab code
FencedCodeBlocks ``` or ~~~ (withoptionallanguage) ```php
HorizontalRules 3+ *, -,or _ ---
Tables Pipetableswithoptionalalignment(:---, :---:, ---:) | Header |
| ------ |
HTMLComments <!-- ... --> Supported(whenmarkupnotescaped)
RawHTMLBlocks Mostblock-levelHTMLtags Supported(whennotinsafe/escapedmode)
LinkReferences [id]: url "title" Definitionstylelinks

Inline elements

Syntax Description Example
Emphasis *text* or _text_ italic
Strong **text** or __text__ bold
InlineCode `code` code
Links [text](url) or [text](url "title") [link](https://example.com)
ReferenceLinks [text][id] Usespreviouslydefinedreferences
Images ![alt](url) or ![alt](url "title") ![alt](image.png)
Autolinks BareURLs(whenenabled) https://example.com
URLTags <https://example.com> Angle-bracketURLs
EmailTags <user@example.com> Angle-bracketemails
Strikethrough ~~text~~ deleted
EscapeSequences \ beforespecialcharacters \*not italic\*
SpecialCharacters/Entities &...; &amp;, &#123;,etc.
RawHTML InlineHTMLtags Supported(whennotescaped/safemode)

Notable behaviors / options that affect syntax

This covers essentially all of the syntax the class actually implements.

← All posts