PHPackages                             techdiary/commonmark-extensions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. techdiary/commonmark-extensions

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

techdiary/commonmark-extensions
===============================

Laravel useful CommonMark extension for Laravel 5, 6 &amp; 7

v2.1.4(5y ago)02MITPHPPHP ^7.1.3

Since Aug 23Pushed 4y agoCompare

[ Source](https://github.com/techdiary-dev/commonmark-extensions)[ Packagist](https://packagist.org/packages/techdiary/commonmark-extensions)[ RSS](/packages/techdiary-commonmark-extensions/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (17)Used By (0)

Laravel Useful CommonMark Extension
===================================

[](#laravel-useful-commonmark-extension)

[![Build Status](https://camo.githubusercontent.com/f6d5d21e01e83be4cc47528e7e329d429e52f441ddf5d4ba201b07401d9bdf3f/68747470733a2f2f7472617669732d63692e636f6d2f6a6f686e6e796875792f6c61726176656c2d75736566756c2d636f6d6d6f6e6d61726b2d657874656e73696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/johnnyhuy/laravel-useful-commonmark-extension)[![Latest Stable Version](https://camo.githubusercontent.com/41fd6e17823dcfb9716399bfcede062a791e022c5bb2ae5fb9b1dbff6c6149c9/68747470733a2f2f706f7365722e707567782e6f72672f6a6f686e6e796875792f6c61726176656c2d75736566756c2d636f6d6d6f6e6d61726b2d657874656e73696f6e2f76657273696f6e)](https://packagist.org/packages/johnnyhuy/laravel-useful-commonmark-extension)[![Total Downloads](https://camo.githubusercontent.com/60477df9f0ea5d6b1dbf9eeb2ab44a6ab43987e836c7ebb7da0de6e7474e2e3d/68747470733a2f2f706f7365722e707567782e6f72672f6a6f686e6e796875792f6c61726176656c2d75736566756c2d636f6d6d6f6e6d61726b2d657874656e73696f6e2f646f776e6c6f616473)](https://packagist.org/packages/johnnyhuy/laravel-useful-commonmark-extension)[![composer.lock available](https://camo.githubusercontent.com/957f86a8b27796293b8168f44fe85e2b99ba69af03a70a63c78455b412433a6d/68747470733a2f2f706f7365722e707567782e6f72672f6a6f686e6e796875792f6c61726176656c2d75736566756c2d636f6d6d6f6e6d61726b2d657874656e73696f6e2f636f6d706f7365726c6f636b)](https://packagist.org/packages/johnnyhuy/laravel-useful-commonmark-extension)

A Laravel PHP Composer packaged of useful CommonMark extensions for The PHP Leagues [CommonMark implementation](https://github.com/thephpleague/commonmark).

- [Laravel Useful CommonMark Extension](#laravel-useful-commonmark-extension)
    - [Getting started](#getting-started)
        - [Prerequisites](#prerequisites)
        - [Installation](#installation)
            - [Installing the Composer package](#installing-the-composer-package)
            - [Adding the Markdown extension to a config](#adding-the-markdown-extension-to-a-config)
    - [Running the tests](#running-the-tests)
    - [Wiki](#wiki)
        - [Markdown features](#markdown-features)
            - [Gist](#gist)
            - [Codepen](#codepen)
            - [SoundCloud](#soundcloud)
            - [YouTube](#youtube)
            - [Color](#color)
            - [Text Alignment](#text-alignment)
    - [Contribution](#contribution)
    - [License](#license)

Getting started
---------------

[](#getting-started)

Instructions to install this extension to your Laravel project.

### Prerequisites

[](#prerequisites)

- PHP &gt;= 7.1
- Laravel &gt;= 5.5 + or 6.0 +

### Installation

[](#installation)

Follow these steps to get this CommonMark extension working in your Laravel project!

#### Installing the Composer package

[](#installing-the-composer-package)

Run the following command at your root Laravel project directory (where `package.json` exists).

```
$ composer require johnnyhuy/laravel-useful-commonmark-extension
```

#### Adding the Markdown extension to a config

[](#adding-the-markdown-extension-to-a-config)

Add `JohnnyHuy\Laravel\UsefulCommonMarkExtension::class` in `config/markdown.php` in the `extensions` array. Here's an example:

```
'extensions' => [
    ...
    JohnnyHuy\Laravel\UsefulCommonMarkExtension::class
    ...
],
```

Running the tests
-----------------

[](#running-the-tests)

Clone this repository and run `composer install` to install all relevant Composer packages. Change the root extension directory and run the following command to execute PHPUnit test cases.

```
$ vendor/bin/phpunit tests/
```

Wiki
----

[](#wiki)

I've composed a wiki page to describe features of this extension.

### Markdown features

[](#markdown-features)

#### Gist

[](#gist)

```
:gist https://gist.github.com/noxify/2b02fd0fb0ea18a4d9d764e31fe9af8e
```

#### Codepen

[](#codepen)

```
:codepen https://codepen.io/YusukeNakaya/pen/XyOaBj
```

#### SoundCloud

[](#soundcloud)

```
:soundcloud https://soundcloud.com/djtechnoboy/tnt-sound-rush-right-now
```

[More info](https://github.com/johnnyhuy/laravel-useful-commonmark-extension/wiki/SoundCloud)

#### YouTube

[](#youtube)

```
:youtube https://www.youtube.com/watch?v=pwmY1XUTBpE
```

[More info](https://github.com/johnnyhuy/laravel-useful-commonmark-extension/wiki/YouTube)

#### Color

[](#color)

```
# Worded colors
:color red
Hello I should be in red text :D
:color

:color-red this is inline! :color

# 3 Character hex
:color #AAA
Hello!
:color

:color-#AAA this is inline! :color

# 6 Character hex
:color #DADADA
Hello!
:color

:color-#DADADA this is inline! :color

# RGB
:color 255,255,255
Hello!
:color

:color-255,255,255 this is inline! :color

# RGBA
:color 255,255,255,50
Hello!
:color

:color-255,255,255,50 this is inline! :color
```

[More info](https://github.com/johnnyhuy/laravel-useful-commonmark-extension/wiki/Color)

#### Text Alignment

[](#text-alignment)

```
# Center alignment
:text-center
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean tincidunt urna maximus sem congue, viverra ultrices purus porta. Aenean at porta mi. Donec ut felis consectetur, rutrum mauris non, sagittis ipsum. Quisque sit amet fringilla lorem. Curabitur euismod imperdiet nunc, et vehicula lorem scelerisque et. Fusce rutrum id lectus in pellentesque. Donec vel cursus dolor. Ut placerat justo nunc, a imperdiet libero posuere non. Nullam dolor ligula, efficitur a accumsan non, viverra quis lorem. Mauris at auctor ligula.
:text-center

# Right alignment
:text-right
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean tincidunt urna maximus sem congue, viverra ultrices purus porta. Aenean at porta mi. Donec ut felis consectetur, rutrum mauris non, sagittis ipsum. Quisque sit amet fringilla lorem. Curabitur euismod imperdiet nunc, et vehicula lorem scelerisque et. Fusce rutrum id lectus in pellentesque. Donec vel cursus dolor. Ut placerat justo nunc, a imperdiet libero posuere non. Nullam dolor ligula, efficitur a accumsan non, viverra quis lorem. Mauris at auctor ligula.
:text-right

# Left alignment
:text-left
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean tincidunt urna maximus sem congue, viverra ultrices purus porta. Aenean at porta mi. Donec ut felis consectetur, rutrum mauris non, sagittis ipsum. Quisque sit amet fringilla lorem. Curabitur euismod imperdiet nunc, et vehicula lorem scelerisque et. Fusce rutrum id lectus in pellentesque. Donec vel cursus dolor. Ut placerat justo nunc, a imperdiet libero posuere non. Nullam dolor ligula, efficitur a accumsan non, viverra quis lorem. Mauris at auctor ligula.
:text-left
```

[More info](https://github.com/johnnyhuy/laravel-useful-commonmark-extension/wiki/Text-Alignment)

Contribution
------------

[](#contribution)

- Project derived from [Graham Campbell](https://github.com/GrahamCampbell)'s [emoji parser](https://github.com/AltThree/Emoji) for Laravel
- **Johnny Huynh** - Initial changes

License
-------

[](#license)

This project is licensed under the MIT license, see [LICENSE](https://github.com/johnnyhuy/laravel-commonmark-useful-extensions/blob/master/LICENSE) for more information.

- **league/commonmark** is licensed under the [BSD-3 license](https://github.com/thephpleague/commonmark/blob/master/LICENSE)
- **GrahamCampbell/Laravel-Markdown** is licensed under the [MIT License](https://github.com/GrahamCampbell/Laravel-Markdown/blob/master/LICENSE)
- **AltThree/Emoji** is licensed under the [MIT License](https://github.com/AltThree/Emoji/blob/master/LICENSE)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 91.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~46 days

Total

16

Last Release

2136d ago

Major Versions

v1.2.1 → v2.0.02019-11-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/2287fefd9e08347ee6d29bcc1dce685db85b8c9da08ae8a1b9511f3d121d07a1?d=identicon)[techdiary](/maintainers/techdiary)

---

Top Contributors

[![johnnyhuy](https://avatars.githubusercontent.com/u/27847622?v=4)](https://github.com/johnnyhuy "johnnyhuy (85 commits)")[![noxify](https://avatars.githubusercontent.com/u/521777?v=4)](https://github.com/noxify "noxify (5 commits)")[![kingRayhan](https://avatars.githubusercontent.com/u/7611746?v=4)](https://github.com/kingRayhan "kingRayhan (3 commits)")

---

Tags

phplaravellaravel-packagemarkdownyoutubecommonmarkphpleague

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/techdiary-commonmark-extensions/health.svg)

```
[![Health](https://phpackages.com/badges/techdiary-commonmark-extensions/health.svg)](https://phpackages.com/packages/techdiary-commonmark-extensions)
```

###  Alternatives

[torchlight/torchlight-commonmark

A Commonmark extension for Torchlight, the syntax highlighting API.

29256.6k6](/packages/torchlight-torchlight-commonmark)[zoon/commonmark-ext-youtube-iframe

Extension for league/commonmark to replace youtube link with iframe

12275.9k1](/packages/zoon-commonmark-ext-youtube-iframe)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[cartalyst/interpret

A driver-based content rendering package, with support for HTML, Markdown &amp; plain text. You can register custom drivers for custom content types.

1914.7k](/packages/cartalyst-interpret)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
