New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

lemaur/markdown

Another Markdown parsers but with super powers
7,966
Install
composer require lemaur/markdown
Latest Version:4.0.2
PHP:^8.2
Laravel:11 · 12 · 13
Older releases:8 · 9 · 10
License:MIT
Last Updated:Oct 21, 2026
Links: GitHub  ·  Packagist
Maintainer: leMaur

Markdown parser with superpowers

Latest Version on Packagist Total Downloads License GitHub Tests Action Status GitHub Code Style Action Status GitHub Sponsors Trees

Support Me

Hey folks,

Do you like this package? Do you find it useful and it fits well in your project?

I am glad to help you, and I would be so grateful if you considered supporting my work.

You can even choose 😃:

Installation

You can install the package via composer:

composer require lemaur/markdown

You can publish the config file with:

php artisan vendor:publish --provider="Lemaur\Markdown\MarkdownServiceProvider" --tag="markdown-config"

Usage

use Lemaur\Markdown;

$markdown = <<<'MD'
# Title

a paragraph with [link](https://website.com).

<x-custom-component></x-custom-component>
MD;

return Markdown::render($markdown);

Code blocks are safe: any Blade-looking syntax inside a fenced (```), indented, or inline (`) code block is displayed as literal text, never executed. So you can document components without them rendering:

```blade
<x-custom-component></x-custom-component>
```

This code-block protection is based on Aaron Francis' article Rendering Blade Components in Markdown.

The Blade pass compiles each document through a temporary view in Laravel's compiled-view directory, keyed by the content hash. That file is kept after rendering (never unlinked), which makes the package safe under multi-worker servers such as Laravel Octane, where deleting it would race with another worker rendering the same document. The number of files is bounded by the number of distinct documents and they are cleared together with the other compiled views.

⚠️ Only render trusted content. Markdown::render() runs the Blade compiler over the document body (outside code blocks), so any Blade or PHP in the prose is executed. Never pass user-generated Markdown to it. Protection covers CommonMark code constructs only — raw HTML <pre>/<code> you write by hand is treated as HTML and is not shielded from Blade.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

dmcbrn/laravel-email-database-log

A simple database logger for all outgoing emails sent by Laravel website - built...

33,964 16
kindari/laravel-markdown

Markdown Integration with Laravel's View system

1,073 40
reg2005/laravel-email-database-log

A simple database logger for all outgoing emails sent by Laravel website.

955 2
tdchien/laravel-email-database-log

A simple database logger for all outgoing emails sent by Laravel website. Forked...

53 3
rtablada/markdown

A laravel style markdown generator using static method calls

26 0

Version History

Version Released PHP Laravel License
4.0.2 ^8.2 ^11.0 || ^12.0 || ^13.0 MIT
4.0.1 ^8.2 ^11.0 || ^12.0 || ^13.0 MIT
4.0.0 ^8.2 ^11.0 || ^12.0 || ^13.0 MIT
3.0.2 ^8.2 ^11.0 || ^12.0 || ^13.0 MIT
3.0.1 ^8.2 ^11.0|^12.0|^13.0 MIT