mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Better Markdown Parser in PHP
https://parsedown.org
0a3fde3774
Resolves #106. This change introduces a new option - `noMarkup`. You could set it the `setNoMarkup()` method similar to the `setBreaksEnabled()` one. Example usage: ``` php <?php $parsedown = new Parsedown(); $parsedown->setNoMarkup(true); $parsedown->text('<div><strong>*Some text*</strong></div>'); // Outputs: // <p><div><strong><em>Some text</em><s;/strong></div></p> ``` |
||
---|---|---|
test | ||
.travis.yml | ||
composer.json | ||
LICENSE.txt | ||
Parsedown.php | ||
phpunit.xml.dist | ||
README.md |
Parsedown
Better Markdown parser for PHP.
Features
- Fast
- Consistent
- GitHub Flavored
- Tested in PHP 5.2, 5.3, 5.4, 5.5, 5.6 and hhvm
- Extensible
- Markdown Extra extension new
- JavaScript port under development new
Installation
Include Parsedown.php
or install the composer package.
Example
$Parsedown = new Parsedown();
echo $Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p>
More examples in the wiki and in this video tutorial.
Questions
How does Parsedown work?
Parsedown recognises that the Markdown syntax is optimised for humans so it tries to read like one. It goes through text line by line. It looks at how lines start to identify blocks. It looks for special characters to identify inline elements.
Why doesn’t Parsedown use namespaces?
Using namespaces would mean dropping support for PHP 5.2. We believe that since Parsedown is a single class with an uncommon name, making this trade wouldn't be worth it.
Is Parsedown compliant with CommonMark?
We are working on it.
Who uses Parsedown?
phpDocumentor, Bolt CMS, RaspberryPi.org and more.