PHPackages                             cable8mm/commonmark-unfenced - 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. cable8mm/commonmark-unfenced

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

cable8mm/commonmark-unfenced
============================

v1.0.0(2y ago)02.0k1MITPHP

Since Apr 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/cable8mm/commonmark-unfenced)[ Packagist](https://packagist.org/packages/cable8mm/commonmark-unfenced)[ RSS](/packages/cable8mm-commonmark-unfenced/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (1)

Unfenced
========

[](#unfenced)

Unleash your fenced code.

An extension for [`league/commonmark`](https://github.com/thephpleague/commonmark/).

Installation
------------

[](#installation)

After installing the package, you will need to register the extension.

### Using `graham-campbell/markdown`

[](#using-graham-campbellmarkdown)

In your `config/markdown.php` file, add the extension somewhere after the `CommonMarkCoreExtension`:

```
  return [
      // ...
      'extensions' => [
          League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension::class,
          League\CommonMark\Extension\GithubFlavoredMarkdownExtension::class,
+         Laravel\Unfenced\UnfencedExtension::class,
      ],
  ];
```

### Manually

[](#manually)

```
use Laravel\Unfenced\UnfencedExtension;
use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
use League\CommonMark\MarkdownConverter;

$environment = new Environment();
$environment->addExtension(new CommonMarkCoreExtension());
$environment->addExtension(new UnfencedExtension());

$converter = new MarkdownConverter($environment);
echo $converter->convert('...');
```

Usage
-----

[](#usage)

Features are enabled via the "info" string of the code fence.

Note

This extension does not include any CSS.

### Adding file names

[](#adding-file-names)

To display a file name above your code, add the `filename` attribute:

```
```php filename=src/Hello.php
// ...
```
```

[![image](https://camo.githubusercontent.com/51d8aaa5531970c75eac99f546680a10d9ab1e2c814c8ecfda56e2d756fd03c8/68747470733a2f2f636162696e65742e70616c676c652e636f6d2f636f6d6d6f6e6d61726b2d756e66656e6365642f756e66656e6365645f66696c656e616d652e706e67)](https://camo.githubusercontent.com/51d8aaa5531970c75eac99f546680a10d9ab1e2c814c8ecfda56e2d756fd03c8/68747470733a2f2f636162696e65742e70616c676c652e636f6d2f636f6d6d6f6e6d61726b2d756e66656e6365642f756e66656e6365645f66696c656e616d652e706e67)

### Adding tabs

[](#adding-tabs)

Adjacent code fences can be grouped into a tabbed view by specifying the `tab` attribute:

```
```vue tab=Vue
// ...
```

```javascript tab=React
// ...
```
```

[![image](https://camo.githubusercontent.com/396723b34998025e9ae17883fdf77f5424abcde474ab1073807cda3b88f5e094/68747470733a2f2f636162696e65742e70616c676c652e636f6d2f636f6d6d6f6e6d61726b2d756e66656e6365642f756e66656e6365645f7461622e706e67)](https://camo.githubusercontent.com/396723b34998025e9ae17883fdf77f5424abcde474ab1073807cda3b88f5e094/68747470733a2f2f636162696e65742e70616c676c652e636f6d2f636f6d6d6f6e6d61726b2d756e66656e6365642f756e66656e6365645f7461622e706e67)

You may also include the `filename` attribute, which is especially helpful when providing code samples where the file name differs depending on the language:

```
```vue tab=Vue filename=Welcome.vue
// ...
```

```javascript tab=React filename=Welcome.jsx
// ...
```
```

[![image](https://camo.githubusercontent.com/137cad5989d26bdf6f79c23240eb7b7c5ae9c2eb1a112b6b7e1279ed939f10e6/68747470733a2f2f636162696e65742e70616c676c652e636f6d2f636f6d6d6f6e6d61726b2d756e66656e6365642f756e66656e6365645f66696c656e616d655f7461622e706e67)](https://camo.githubusercontent.com/137cad5989d26bdf6f79c23240eb7b7c5ae9c2eb1a112b6b7e1279ed939f10e6/68747470733a2f2f636162696e65742e70616c676c652e636f6d2f636f6d6d6f6e6d61726b2d756e66656e6365642f756e66656e6365645f66696c656e616d655f7461622e706e67)

The extension will inject JavaScript into your page when tabs are used. The JavaScript enables the following features:

- It will apply an `active` class to the active tab button and tab content. You may use CSS to highlight the active tab, and hide the inactive tab content.
- If multiple tabbed sections are found, and they contain identical tab names, they will be synchronized. I.e, clicking the "React" tab in one section, will switch to that tab in all sections.
- The active tab is saved to the browsers local storage so that it persists between pages and visits.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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

Unknown

Total

1

Last Release

763d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c910c874a0263a18f9f976273054cd45faa3ffbcba7891992f4ab52d0656dd93?d=identicon)[Sam Lee](/maintainers/Sam%20Lee)

---

Top Contributors

[![jessarcher](https://avatars.githubusercontent.com/u/4977161?v=4)](https://github.com/jessarcher "jessarcher (10 commits)")[![cable8mm](https://avatars.githubusercontent.com/u/2672043?v=4)](https://github.com/cable8mm "cable8mm (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cable8mm-commonmark-unfenced/health.svg)

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

###  Alternatives

[spatie/laravel-markdown

A highly configurable markdown renderer and Blade component for Laravel

4053.4M35](/packages/spatie-laravel-markdown)[mnapoli/front-yaml

2895.6M45](/packages/mnapoli-front-yaml)[daux/daux.io

Documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly

825191.0k1](/packages/daux-dauxio)[spatie/sheets

Store &amp; retrieve your static content in plain text files

30187.7k4](/packages/spatie-sheets)[prezet/prezet

Prezet: Markdown Blogging for Laravel

2969.8k2](/packages/prezet-prezet)[sinnbeck/markdom

Converts markdown to html with classes

69122.6k2](/packages/sinnbeck-markdom)

PHPackages © 2026

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