Light and fast markdown parser, that parses markdown in a way human does
htmlup
is ultra lightweight and uber speedy markdown to html parser written in PHP.
Concept - it splits the markdown into lines and parses to markup one by one, finally applies markdown syntaxes on the markup.
It supports most of the markdown as in specs.
Run composer require adhocore/htmlup
<?php
use Ahc\HtmlUp;
// require '/path/to/vendor/autoload.php';
// Defaults to 4 space indentation.
echo new Ahc\HtmlUp($markdownText);
// Force 2 space indentation.
echo new HtmlUp($markdownText, 2);
// Also possible:
echo (new Htmlup)->parse($markdownText);
It provides limited support to deep nested elements, supported items are:
you can throw in your raw html but with a blank line at start and end to delimit the block at like so-
<dl>
<dt>
A
</dt>
<dd>Apple
</dd>
<dt>B
</dt>
<dd>
Ball</dd>
</dl>
supports GFM table syntax, example:
a | b | c
--- |----| ---
1 | 2 |3
4| 5 | 6
is rendered as:
a | b | c |
---|---|---|
1 | 2 | 3 |
4 | 5 | 6 |
© 2014-2018 | Jitendra Adhikari | MIT