PHPackages                             rankletter/commonmark-ext-seo-image - 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. [Image &amp; Media](/categories/media)
4. /
5. rankletter/commonmark-ext-seo-image

ActiveCommonmark-extension[Image &amp; Media](/categories/media)

rankletter/commonmark-ext-seo-image
===================================

Adds support for explicit width and height as well as lazy loading to the league/commonmark markdown parser package

0.1.0(4y ago)19MITPHPPHP ^7.3 || ^8.0

Since May 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/RankLetter/commonmark-ext-seo-image)[ Packagist](https://packagist.org/packages/rankletter/commonmark-ext-seo-image)[ Docs](https://github.com/RankLetter/commonmark-ext-seo-image)[ RSS](/packages/rankletter-commonmark-ext-seo-image/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

SEO Image Extension for league/commonmark
=========================================

[](#seo-image-extension-for-leaguecommonmark)

**🚧️ This extension is work in progress. Until 1.0 is release breaking changes might happen. Use with caution.**

[![Tests](https://github.com/RankLetter/commonmark-ext-seo-image/workflows/Tests/badge.svg)](https://github.com/RankLetter/commonmark-ext-seo-image/workflows/Tests/badge.svg)

This image extension for [league/commonmark](https://github.com/thephpleague/commonmark) adds:

- the lazy loading attribute as well as
- explicit `height` and `width` attributes to keep the layout shifts to a minimum. This works for both absolute URLs and local images.

The package is largely based on [simonvomeyser/commonmark-ext-lazy-image](https://github.com/simonvomeyser/commonmark-ext-lazy-image)! It is licensed under the same [MIT license](/license).

Install
-------

[](#install)

```
composer require rankletter/commonmark-ext-seo-image
```

Example
-------

[](#example)

Assuming `/path/to/image.jpg` points to an image with a size of 1024x512 pixels, the following example

```
use League\CommonMark\Environment;
use RankLetter\CommonMarkImageExtension\SEOImageExtension;

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

$converter = new CommonMarkConverter([], $this->environment);
$html = $converter->convertToHtml('![alt text](/path/to/image.jpg)');
```

This creates the following HTML

```

```

Further Options
---------------

[](#further-options)

Further options to replicate the lazy loading using JavaScript packages are supported. For more details please check the [original package](https://github.com/simonvomeyser/commonmark-ext-lazy-image#options). This functionality will remain for now.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

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

1812d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8433587?v=4)[Peter Thaleikis](/maintainers/spekulatius)[@spekulatius](https://github.com/spekulatius)

---

Top Contributors

[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (2 commits)")

---

Tags

commonmarkcommonmark-extensionseo-optimizationseo-pluginimagemarkdowncommonmarkextensionlazyexplicit width and height

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rankletter-commonmark-ext-seo-image/health.svg)

```
[![Health](https://phpackages.com/badges/rankletter-commonmark-ext-seo-image/health.svg)](https://phpackages.com/packages/rankletter-commonmark-ext-seo-image)
```

###  Alternatives

[simonvomeyser/commonmark-ext-lazy-image

Adds support for lazy images to the phpleague/commonmark markdown parser package

1821.3k1](/packages/simonvomeyser-commonmark-ext-lazy-image)[maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

1020.8k](/packages/maxmirazh33-yii2-uploadable-cropable-image)[somehow-digital/typo3-media-processing

Media Processing

101.1k](/packages/somehow-digital-typo3-media-processing)

PHPackages © 2026

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