PHPackages                             benfiratkaya/commonmark-ext-link-text-viewer - 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. benfiratkaya/commonmark-ext-link-text-viewer

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

benfiratkaya/commonmark-ext-link-text-viewer
============================================

This extension provides support for changing the content of links to url for phpleague/commonmark markdown parser package.

1.0.1(4y ago)018MITPHPPHP ^7.4 || ^8.0

Since Feb 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/benfiratkaya/commonmark-ext-link-text-viewer)[ Packagist](https://packagist.org/packages/benfiratkaya/commonmark-ext-link-text-viewer)[ RSS](/packages/benfiratkaya-commonmark-ext-link-text-viewer/feed)WikiDiscussions main Synced 1mo ago

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

Extension to change link content to url
=======================================

[](#extension-to-change-link-content-to-url)

[![Tests](https://github.com/benfiratkaya/commonmark-ext-link-text-viewer/workflows/PHP%20Composer/badge.svg)](https://github.com/benfiratkaya/commonmark-ext-link-text-viewer/workflows/PHP%20Composer/badge.svg)

This extension provides support for changing the content of links to url for [league/commonmark](https://github.com/thephpleague/commonmark) package version `^2.0`.

Install
-------

[](#install)

```
composer require benfiratkaya/commonmark-ext-link-text-viewer
```

Example
-------

[](#example)

```
use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
use BenFiratKaya\CommonMarkExtension\LinkTextViewerExtension;

$environment = new Environment([]);
$environment->addExtension(new CommonMarkCoreExtension())
            ->addExtension(new LinkTextViewerExtension());

$converter = new MarkdownConverter($environment);
$html = $converter->convertToHtml('[text](http://example.test)');
```

This creates the following HTML

```
http://example.test
```

Options
-------

[](#options)

```
//...
$environment = new Environment([]);
$environment->addExtension(new CommonMarkCoreExtension())
            ->addExtension(new LinkTextViewerExtension());

$converter = new MarkdownConverter([
  'link_text_viewer' => [
      'internal_hosts' => '/(^|\.)internal\.test$/', // TODO: Don't forget to set this!
      'link_type' => 'all', // Set '' to disable. Variables: all, external, internal
  ],
], $environment)
$html = $converter->convertToHtml('[text](http://example.test)');
```

This creates the following HTML

```
http://example.test
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Every ~14 days

Total

2

Last Release

1529d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/22c3156714cb5ef9745bf9c32b71230fd95b7d21b5815e1e7ad1618c285ff8b1?d=identicon)[benfiratkaya](/maintainers/benfiratkaya)

---

Top Contributors

[![benfiratkaya](https://avatars.githubusercontent.com/u/48600092?v=4)](https://github.com/benfiratkaya "benfiratkaya (7 commits)")

---

Tags

linkmarkdowntextcommonmarkextension

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/benfiratkaya-commonmark-ext-link-text-viewer/health.svg)

```
[![Health](https://phpackages.com/badges/benfiratkaya-commonmark-ext-link-text-viewer/health.svg)](https://phpackages.com/packages/benfiratkaya-commonmark-ext-link-text-viewer)
```

###  Alternatives

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