PHPackages                             cassarco/league-commonmark-wikilinks - 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. cassarco/league-commonmark-wikilinks

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

cassarco/league-commonmark-wikilinks
====================================

An extension that enables wikilinks parsing in league/commonmark.

v1.0.2(2y ago)34001MITPHPPHP ^8.3

Since Mar 18Pushed 2y agoCompare

[ Source](https://github.com/cassarco/league-commonmark-wikilinks)[ Packagist](https://packagist.org/packages/cassarco/league-commonmark-wikilinks)[ Docs](https://github.com/cassarco/league-commonmark-wikilinks)[ GitHub Sponsors](https://github.com/cassarco)[ RSS](/packages/cassarco-league-commonmark-wikilinks/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (1)

league-commonmark-wikilinks
===========================

[](#league-commonmark-wikilinks)

[![Latest Version on Packagist](https://camo.githubusercontent.com/555dbcbfda1e2ab6e281b934c24ec89adff1e2c88fc901b9dc80a050561a360d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636173736172636f2f6c65616775652d636f6d6d6f6e6d61726b2d77696b696c696e6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cassarco/league-commonmark-wikilinks)[![Tests](https://camo.githubusercontent.com/b008e5eda7b3fcf4b85c2cfae8a56d0d39ae10ca8f71eb3a2d42caf27edae7cb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636173736172636f2f6c65616775652d636f6d6d6f6e6d61726b2d77696b696c696e6b732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/cassarco/league-commonmark-wikilinks/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/38c6162445ae9ede81512ac29ad1ca3ac60419c31c4663cffc524e1deaded4bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636173736172636f2f6c65616775652d636f6d6d6f6e6d61726b2d77696b696c696e6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cassarco/league-commonmark-wikilinks)

An extension for league-commonmark that lets you use Wikilinks in your markdown files. These will be converted to html as you have come to expect from other apps that support Wikilinks such as Wikipedia and Obsidian.

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

[](#installation)

You can install the package via composer:

```
composer require cassarco/league-commonmark-wikilinks
```

Usage
-----

[](#usage)

```
use League\CommonMark\MarkdownConverter;
use Cassarco\LeagueCommonmarkWikilinks\WikilinksExtension;

$environment = new Environment();

$environment->addExtension(new CommonMarkCoreExtension());
$environment->addExtension(new WikiLinksExtension());

$markdown = "[[Hello World]]";

(new MarkdownConverter($environment))->convert($markdown);

// Hello World
```

Features
--------

[](#features)

### Convert Wikilinks to HTML Links

[](#convert-wikilinks-to-html-links)

Surround text in double braces and this extension will automatically convert the Wikilink into an html link with a suitable title and text.

```
$markdown = '[[Hello World]]';

// Hello World
```

### Support for Looks-like Text

[](#support-for-looks-like-text)

Looks-like text can be used to modify the title and text of the resulting `a` tag.

```
$markdown = '[[Hello World|Welcome]]';

// Welcome
```

### Support for Hash Links

[](#support-for-hash-links)

You can optionally include hash links by adding a `#` followed by the hash link text to the end of the Wikilink.

```
$markdown = '[[Hello World#Top]]';

// Hello World &gt; Top
```

### Support for Hash Links combined with Looks-like Text

[](#support-for-hash-links-combined-with-looks-like-text)

Of course, you can use looks-like text and hash links in combination.

```
$markdown = '[[Hello World#Top|Welcome]]';

// Welcome
```

### Support for Link Prefixes

[](#support-for-link-prefixes)

A `prefix` configuration option can be used to prefix a string to the beginning of the href url.

```
$markdown = '[[Hello World#Top|Welcome]]';

(new MarkdownConverter($environment))->convert($markdown, [
    'prefix' => 'articles/',
]

// Welcome
```

### Handles Edge Cases Gracefully

[](#handles-edge-cases-gracefully)

I've tried to think of all the edge cases, but there will doubtless be more. Please submit a bug report if you encounter any issues and I will try to resolve them.

```
    $markdown = '[[]]'; //[[]]
    $markdown = '[Hello World]'; // [Hello World]
    $markdown = '[[Hello World'; // [[Hello World
    $markdown = 'Hello World]]'; // Hello World]]
    $markdown = '[[Hello World]]]]'; // [[Hello World]]]]
    $markdown = '[[      Hello World]]'; //       Hello World
    $markdown = '[[Hello World|||Welcome]]'; // [[Hello World|||Welcome]]
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you find a bug that impacts the security of this package please send an email to  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Carl Cassar](https://carlcassar.com)
- [Cassar &amp; Co](https://github.com/cassarco)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% 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 ~3 days

Total

3

Last Release

777d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7ae4bbca64ee6c8297dbe10188208542e00f455fddce429574a34fd47fb7cf6?d=identicon)[cassarco](/maintainers/cassarco)

---

Top Contributors

[![carlcassar](https://avatars.githubusercontent.com/u/6062337?v=4)](https://github.com/carlcassar "carlcassar (26 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

league-commonmarkmarkdownphpwikilinksmarkdowncassarcowikilinksleague-commonmark-wikilinks

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cassarco-league-commonmark-wikilinks/health.svg)

```
[![Health](https://phpackages.com/badges/cassarco-league-commonmark-wikilinks/health.svg)](https://phpackages.com/packages/cassarco-league-commonmark-wikilinks)
```

###  Alternatives

[daux/daux.io

Documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly

825191.0k1](/packages/daux-dauxio)[bookdown/bookdown

Provides DocBook-like rendering of Markdown files.

8257.6k16](/packages/bookdown-bookdown)[torchlight/torchlight-commonmark

A Commonmark extension for Torchlight, the syntax highlighting API.

29256.6k6](/packages/torchlight-torchlight-commonmark)[maglnet/magl-markdown

Provides a ZF2 View Helper to render markdown syntax. It uses third-party libraries for the rendering and you can switch between different renderers.

22178.2k4](/packages/maglnet-magl-markdown)[zoon/commonmark-ext-youtube-iframe

Extension for league/commonmark to replace youtube link with iframe

12275.9k1](/packages/zoon-commonmark-ext-youtube-iframe)[spatie/commonmark-wire-navigate

Add a wire:navigate attribute to links rendered in Markdown

1010.7k](/packages/spatie-commonmark-wire-navigate)

PHPackages © 2026

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