Parsedown converts Markdown text to HTML in PHP with no extra dependencies. It targets speed, a small footprint, and optional hardening for untrusted input.
Overview
Parsedown is a Markdown parser implemented as one PHP file that projects can vendor or install through Composer. It focuses on a line-based reading strategy: the parser infers block structure from how lines begin, then processes inline syntax, which the author describes as distinct from many earlier PHP Markdown implementations.
The library supports GitHub Flavored Markdown and reports passing most CommonMark tests, with gaps mainly on uncommon edge cases. It can escape user content in generated HTML and offers a safe mode aimed at reducing cross-site scripting when rendering untrusted Markdown, plus guidance when allowing limited HTML.
Parsedown is used inside several PHP CMS and documentation stacks named in project materials, including Laravel, multiple flat-file CMS products, phpDocumentor, and Symfony demo projects. Inline-only parsing is supported for fragments without full document wrappers.
Key features
- One-file implementation
- No external dependencies
- GitHub Flavored Markdown
- CommonMark-oriented parsing
- Safe mode for untrusted input
- Inline Markdown parsing
- Composer package install
- Extensible design
Use cases
- Rendering Markdown in PHP CMS sites
- Converting user comments to HTML
- Documentation pages in PHP apps
- Lightweight blog or static content
- Sanitized untrusted Markdown display