Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Parsedown Extra

Parsedown Extra Laravel Package

erusev/parsedown-extra

Parsedown Extra is a fast PHP Markdown parser with support for Markdown Extra features like tables, footnotes, definition lists, abbreviations, and more. Ideal for turning user-written Markdown into HTML in apps, docs, and CMS workflows.

Deep Wiki
Context7

erusev/parsedown-extra is a fast, lightweight Markdown parser for PHP with support for “Extra” syntax (tables, footnotes, definition lists, and more). It’s designed for straightforward integration in PHP/Laravel projects where you need reliable Markdown-to-HTML conversion with minimal overhead.

Use it to render user content, documentation, or CMS pages while keeping output consistent and configurable.

  • Markdown Extra support: tables, footnotes, definition lists, abbreviations
  • High performance parsing with a small footprint
  • Simple API for converting Markdown to HTML
  • Extensible behavior via configuration and overrides
  • Suitable for apps, blogs, and documentation pipelines
Frequently asked questions about Parsedown Extra
How do I install Parsedown Extra in a Laravel project?
Run `composer require erusev/parsedown-extra` to install the package. It depends on `erusev/parsedown`, which will auto-install. No additional Laravel-specific setup is required unless you want to bind it as a singleton or create a facade.
Does Parsedown Extra support Laravel Blade templates?
Yes, you can integrate it with Blade by creating a custom directive like `@markdown` or binding it as a service provider. This lets you render Markdown directly in views without extra logic.
What Laravel versions does this package support?
Parsedown Extra works with Laravel 9+ (PHP 8.0+) since it depends on Parsedown 2.0+. It’s fully compatible with Laravel’s latest LTS releases and avoids version conflicts.
Can I use this for user-generated content like forum posts or comments?
Yes, but sanitize the output to prevent XSS. Parsedown Extra converts Markdown to HTML, so always escape or whitelist allowed tags if users can input raw Markdown.
How do I extend Parsedown Extra for custom syntax (e.g., shortcodes)?
Use Parsedown’s extension system. Create a custom extension class and register it with `ParsedownExtra::addExtension()`. This lets you add features like shortcodes, custom block types, or GitHub-flavored tables.
Is Parsedown Extra faster than other Markdown parsers like CommonMark?
Yes, it’s optimized for speed with a lightweight footprint (~10KB). It’s ideal for high-traffic Laravel apps where performance matters, especially if you only need Markdown Extra features.
How do I cache parsed Markdown to avoid reprocessing on every request?
Use Laravel’s cache drivers with `Cache::remember()`. Store the parsed HTML for a key like `markdown:{$contentHash}` and set a TTL (e.g., 1 hour) for dynamic content.
What happens if a user submits malformed Markdown (e.g., broken tables)?
Parsedown Extra gracefully handles malformed input by outputting raw HTML or skipping invalid blocks. Test edge cases in your app to ensure robustness, especially for public-facing content.
Can I use this package in API responses to return HTML from Markdown fields?
Absolutely. Inject the parser as a service and use it in controllers to convert Markdown fields (e.g., `Post::content`) to HTML before returning JSON or rendering views.
What are the alternatives to Parsedown Extra in Laravel?
Alternatives include `spatie/laravel-markdown` (wraps Parsedown), `league/commonmark` (full CommonMark support), or `michelf/php-markdown` (older but feature-rich). Parsedown Extra is lighter and focuses on Markdown Extra syntax.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
redaxo/debug
redaxo/test
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder