PHPackages                             eberdna/commonmark-ext-prepend-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. eberdna/commonmark-ext-prepend-image

ActiveCommononmark-extension[Utility &amp; Helpers](/categories/utility)

eberdna/commonmark-ext-prepend-image
====================================

Adds the possibility to prepend the image path/route

1.0.0(5y ago)0284MITPHP

Since Sep 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/eBerdnA/commonmark-ext-prepend-image)[ Packagist](https://packagist.org/packages/eberdna/commonmark-ext-prepend-image)[ RSS](/packages/eberdna-commonmark-ext-prepend-image/feed)WikiDiscussions master Synced 3w ago

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

Extension to render lazy images in markdown
===========================================

[](#extension-to-render-lazy-images-in-markdown)

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

This adds support to prepend image path/routes to the [league/commonmark](https://github.com/thephpleague/commonmark) package.

Install
-------

[](#install)

```
composer require eberdna/commonmark-ext-prepend-image
```

Example
-------

[](#example)

```
use League\CommonMark\Environment;
use AndreBering\CommonMarkExtension\PrependImageExtension;

$this->environment = Environment::createCommonMarkEnvironment();
$this->environment->addExtension(new PrependImageExtension('/path/to/files/'));

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

This creates the following HTML

```

```

**Please note that the path is only prepended if the markdown picture path does not start with `'/'`, `'//'` or `'http'`.**

Options
-------

[](#options)

There are no options for this extension. Only base path can set when creating the instance of `PrependImageExtension`.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

2108d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2204092?v=4)[André Bering](/maintainers/eberdna)[@eBerdnA](https://github.com/eBerdnA)

---

Top Contributors

[![eBerdnA](https://avatars.githubusercontent.com/u/2204092?v=4)](https://github.com/eBerdnA "eBerdnA (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M19.9k](/packages/laravel-framework)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[roundcube/roundcubemail

The Roundcube Webmail suite

7.1k2.4k3](/packages/roundcube-roundcubemail)[phlak/directory-lister

PHP directory lister

2.5k1.4k](/packages/phlak-directory-lister)

PHPackages © 2026

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