Install Parsedown manually
masterParsedown.php file in your project.repository·master·Indexed 12 days ago
https://github.com/erusev/parsedownA fast, extensible, and dependency-free GitHub-flavored Markdown parser for PHP. It provides methods for full Markdown parsing via text() and inline parsing via line(), with built-in Safe Mode for sanitizing untrusted user input.
Parsedown.php file in your project.The easiest way to install Parsedown is using Composer. Run the following command in your terminal:
composer require erusev/parsedownTo convert Markdown text into HTML, instantiate the Parsedown class and use the text() method. For parsing only inline Markdown elements without block-level wrapping, use the line() method.
$Parsedown = new Parsedown();
// Full Markdown parsing
echo $Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p>
// Inline Markdown parsing only
echo $Parsedown->line('Hello _Parsedown_!'); # prints: Hello <em>Parsedown</em>!When processing untrusted user input, you should enable Safe Mode to escape user-provided HTML and sanitize scripting vectors (like malicious link destinations) introduced by Markdown syntax. Use setSafeMode(true) to activate this protection.
$Parsedown->setSafeMode(true);If you are processing trusted input but want to escape any HTML tags present, use setMarkupEscaped(true).
WARNING: This method is not safe from XSS. It does not protect against unsafe scripting vectors embedded in Markdown, such as [xss](javascript:alert%281%29).
$Parsedown->setMarkupEscaped(true);