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. eberdna/commonmark-ext-prepend-image

ActiveCommononmark-extension

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 today

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 43% 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

2056d 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.6k509.9M17.0k](/packages/laravel-framework)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[graham-campbell/markdown

Markdown Is A CommonMark Wrapper For Laravel

1.3k7.1M64](/packages/graham-campbell-markdown)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[phiki/phiki

Syntax highlighting using TextMate grammars in PHP.

3573.0M23](/packages/phiki-phiki)[laravel-lang/publisher

Localization publisher for your Laravel application

2167.7M24](/packages/laravel-lang-publisher)

PHPackages © 2026

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