PHPackages                             divineomega/php-wikitext-parser - 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. divineomega/php-wikitext-parser

Abandoned → [jord-jd/php-wikitext-parser](/?search=jord-jd%2Fphp-wikitext-parser)Library[Parsing &amp; Serialization](/categories/parsing)

divineomega/php-wikitext-parser
===============================

Parse Wikitext in PHP

v3.1.0(1mo ago)42461LGPL-3.0-onlyPHPPHP &gt;=7.1CI passing

Since Apr 28Pushed 1mo agoCompare

[ Source](https://github.com/Jord-JD/php-wikitext-parser)[ Packagist](https://packagist.org/packages/divineomega/php-wikitext-parser)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-php-wikitext-parser/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

PHP Wikitext Parser
===================

[](#php-wikitext-parser)

Convert wikitext to HTML or readable plain text through the current MediaWiki Action API.

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

[](#installation)

```
composer require jord-jd/php-wikitext-parser
```

Usage
-----

[](#usage)

```
use JordJD\WikitextParser\Parser;

$parser = (new Parser())
    ->setWikitext("'''Hello''' [[world]]!");

$plainText = $parser->parse();
```

`JordJD\WikitextParser\WikitextParser` is also provided as a descriptive alias for compatibility with examples from older documentation.

### HTML output

[](#html-output)

```
use JordJD\WikitextParser\Enums\Format;

$html = $parser
    ->setFormat(Format::HTML)
    ->parse();
```

Only `Format::PLAIN_TEXT` and `Format::HTML` are accepted. Plain text preserves useful block and line-break whitespace while removing markup, scripts, and styles.

### Page context and other MediaWiki installations

[](#page-context-and-other-mediawiki-installations)

Templates and magic words can depend on a page title. Supply it with `setTitle()`. A trusted alternate MediaWiki Action API can be selected with `setEndpoint()`:

```
$result = (new Parser())
    ->setEndpoint('https://de.wikipedia.org/w/api.php')
    ->setTitle('Beispiel')
    ->setWikitext($wikitext)
    ->parse();
```

The parser sends wikitext with POST, so large inputs are not constrained by URL length. API, HTTP, JSON, and malformed-response failures throw a `RuntimeException` with a clear reason.

Caching
-------

[](#caching)

Parsed output is cached indefinitely in a system temporary directory by default, avoiding writes inside `vendor/`. Supply any PSR-6 pool, configure a TTL, or disable caching:

```
$parser = (new Parser($yourPsr6Cache))
    ->setCacheTtl(3600);

$uncached = (new Parser())
    ->disableCache();
```

Custom HTTP transport
---------------------

[](#custom-http-transport)

The optional second constructor argument is a callable receiving the endpoint, POST body, headers, and timeout. It must return the response body as a string:

```
$parser = new Parser(
    null,
    function (string $endpoint, string $body, array $headers, int $timeout): string {
        return $yourHttpClient->post($endpoint, $body, $headers, $timeout);
    },
    10,
    'your-application/1.0 (https://example.com/contact)'
);
```

The package supports PHP 7.1 through current PHP 8.x releases and accepts both v3 and v4 of `jord-jd/do-file-cache-psr-6`.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance94

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~527 days

Recently: every ~635 days

Total

6

Last Release

30d ago

Major Versions

v1.0.2 → v2.0.02026-02-14

v2.0.0 → v3.0.02026-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (10 commits)")

---

Tags

parserphp-librarywikitextwikitext-parser

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/divineomega-php-wikitext-parser/health.svg)

```
[![Health](https://phpackages.com/badges/divineomega-php-wikitext-parser/health.svg)](https://phpackages.com/packages/divineomega-php-wikitext-parser)
```

###  Alternatives

[mwgg/airports

A JSON collection of ~29k entries with basic information about nearly every airport and landing strip in the world

7683.4k](/packages/mwgg-airports)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9845.4k](/packages/sauladam-shipment-tracker)[glauberportella/cnab-layouts-parser

Parser de arquivos de configuração CNAB gerados no projeto https://github.com/glauberportella/cnab-layouts

2154.5k](/packages/glauberportella-cnab-layouts-parser)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.4k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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