PHPackages                             cradeq/commonmark-html-whitelist-extension - 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. cradeq/commonmark-html-whitelist-extension

ActiveCommonmark-extension[Parsing &amp; Serialization](/categories/parsing)

cradeq/commonmark-html-whitelist-extension
==========================================

Allows HTML tags to be used in Markdown, while still escaping or stripping all other HTML input.

v1.0.1(1y ago)28.9k↓25.7%MITPHPPHP ^8.1

Since Dec 4Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Cradeq/commonmark-html-whitelist-extension)[ Packagist](https://packagist.org/packages/cradeq/commonmark-html-whitelist-extension)[ Docs](https://github.com/Cradeq/commonmark-html-whitelist-extension)[ RSS](/packages/cradeq-commonmark-html-whitelist-extension/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

CommonMark HTML Whitelist Extension
-----------------------------------

[](#commonmark-html-whitelist-extension)

This package allows any HTML tags to be used in Markdown, while still escaping or stripping all other HTML input. Only tags without attributes or styling are supported. Content of the HTML elements remains intact.

Install
-------

[](#install)

This project can be installed via composer:

```
composer require cradeq/commonmark-html-whitelist-extension

```

Usage
-----

[](#usage)

```
use Cradeq\CommonMark\HtmlWhitelistExtension;
use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;

$environment = new Environment([
    'html_input' => 'strip', // Both strip and escape are supported
    'html_whitelist' => [
        'tags' => ['br', 'sub'], // Any set of html tags
    ],
]);
$environment->addExtension(new CommonMarkCoreExtension);
$environment->addExtension(new HtmlWhitelistExtension);
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance44

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% 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 ~182 days

Total

2

Last Release

439d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9b9b3ba9b4e16a32b0d4b47ef5125dc9470770592979d55b1fdcbcbdb06d3a3?d=identicon)[chillbram](/maintainers/chillbram)

---

Top Contributors

[![chillbram](https://avatars.githubusercontent.com/u/7299762?v=4)](https://github.com/chillbram "chillbram (9 commits)")[![MaartenCradeq](https://avatars.githubusercontent.com/u/73559592?v=4)](https://github.com/MaartenCradeq "MaartenCradeq (1 commits)")

---

Tags

htmlmarkdowncommonmarkextensiontags

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cradeq-commonmark-html-whitelist-extension/health.svg)

```
[![Health](https://phpackages.com/badges/cradeq-commonmark-html-whitelist-extension/health.svg)](https://phpackages.com/packages/cradeq-commonmark-html-whitelist-extension)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.6k10](/packages/helsingborg-stad-municipio)[petebishwhip/laradocs

Maintain beautiful, version-controlled documentation alongside your Laravel codebase. Markdown in, a polished docs site out.

11419.8k](/packages/petebishwhip-laradocs)

PHPackages © 2026

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