PHPackages                             webuni/commonmark-attributes-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. webuni/commonmark-attributes-extension

Abandoned → [league/commonmark](/?search=league%2Fcommonmark)ArchivedCommonmark-extension[Parsing &amp; Serialization](/categories/parsing)

webuni/commonmark-attributes-extension
======================================

The attributes extension adds a syntax to define attributes on the various HTML elements in CommonMark PHP implementation.

1.0.0(6y ago)33153.8k↓23.1%1410MITPHPPHP ^7.1

Since Jul 13Pushed 5y ago3 watchersCompare

[ Source](https://github.com/webuni/commonmark-attributes-extension)[ Packagist](https://packagist.org/packages/webuni/commonmark-attributes-extension)[ Docs](https://github.com/webuni/commonmark-attributes-extension)[ RSS](/packages/webuni-commonmark-attributes-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (10)Used By (10)

CommonMark Attributes Extension
===============================

[](#commonmark-attributes-extension)

[![Packagist](https://camo.githubusercontent.com/371d93ed7087d3344afa31d98c0ef31e827f1b48d4cd01ec8880647b6167f5ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776562756e692f636f6d6d6f6e6d61726b2d617474726962757465732d657874656e73696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/webuni/commonmark-attributes-extension)[![Build Status](https://camo.githubusercontent.com/acfad653629f15753856643d6afdd259f1f631201699f65af5e326c821e12640/68747470733a2f2f7472617669732d63692e6f72672f776562756e692f636f6d6d6f6e6d61726b2d617474726962757465732d657874656e73696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/webuni/commonmark-attributes-extension)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f55f62fffa913b88bb08cc0aa167cdff157ca206210adbd312a1e0f4762f8c93/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f776562756e692f636f6d6d6f6e6d61726b2d617474726962757465732d657874656e73696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/webuni/commonmark-attributes-extension/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/e021b27d8d2e6cb4931d26bcec6cbd38c2bce66e952c63ac239a6ed80ec48924/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f776562756e692f636f6d6d6f6e6d61726b2d617474726962757465732d657874656e73696f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/webuni/commonmark-attributes-extension/?branch=master)

The Attributes extension adds a syntax to define attributes on the various HTML elements in markdown’s output.

DEPRECATED
----------

[](#deprecated)

**This extension has been deprecated**. All of its functionality now exists in [`league/commonmark`](https://github.com/thephpleague/commonmark) 1.5+ under the `League\CommonMark\Extension\Attributes` namespace, so you should upgrade to that version and use that bundled extension instead of this one.

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

[](#installation)

This project can be installed via Composer:

```
composer require webuni/commonmark-attributes-extension

```

Usage
-----

[](#usage)

```
use League\CommonMark\Converter;
use League\CommonMark\DocParser;
use League\CommonMark\Environment;
use League\CommonMark\HtmlRenderer;
use Webuni\CommonMark\AttributesExtension\AttributesExtension;

$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new AttributesExtension());

$converter = new Converter(new DocParser($environment), new HtmlRenderer($environment));

echo $converter->convertToHtml('# Hello World!');
```

Syntax
------

[](#syntax)

The basic syntax was inspired by [Kramdown](http://kramdown.gettalong.org/syntax.html#attribute-list-definitions)‘s Attribute Lists feature.

You can assign any attribute to a block-level element. Just directly prepend or follow the block with a block inline attribute list. That consists of a left curly brace, optionally followed by a colon, the attribute definitions and a right curly brace:

```
> A nice blockquote
{: title="Blockquote title"}

{#id .class}
## Header
```

As with a block-level element you can assign any attribute to a span-level elements using a span inline attribute list, that has the same syntax and must immediately follow the span-level element:

```
This is *red*{style="color: red"}.
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 77.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 ~190 days

Recently: every ~351 days

Total

9

Last Release

2441d ago

Major Versions

0.5.0 → 1.0.02019-09-11

PHP version history (2 changes)0.1.0PHP &gt;=5.4

1.0.0PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/306adbad9084ed5c22aa85cbfce4899263466d76dff211b5c4c9f54dc23c40a1?d=identicon)[hason](/maintainers/hason)

---

Top Contributors

[![hason](https://avatars.githubusercontent.com/u/288535?v=4)](https://github.com/hason "hason (24 commits)")[![defr](https://avatars.githubusercontent.com/u/204727?v=4)](https://github.com/defr "defr (1 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (1 commits)")[![jdavidbakr](https://avatars.githubusercontent.com/u/25177?v=4)](https://github.com/jdavidbakr "jdavidbakr (1 commits)")[![markhalliwell](https://avatars.githubusercontent.com/u/351902?v=4)](https://github.com/markhalliwell "markhalliwell (1 commits)")[![marktopper](https://avatars.githubusercontent.com/u/2232539?v=4)](https://github.com/marktopper "marktopper (1 commits)")[![colinodell](https://avatars.githubusercontent.com/u/202034?v=4)](https://github.com/colinodell "colinodell (1 commits)")[![onigoetz](https://avatars.githubusercontent.com/u/309594?v=4)](https://github.com/onigoetz "onigoetz (1 commits)")

---

Tags

attributescommonmarkmarkdowncommonmarkattributes

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/webuni-commonmark-attributes-extension/health.svg)

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

###  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)

PHPackages © 2026

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