PHPackages                             bueltge/marksimple - 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. bueltge/marksimple

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

bueltge/marksimple
==================

A simple Markdown parser for PHP.

2.2.0(3y ago)146.9k8[2 issues](https://github.com/bueltge/marksimple/issues)MITPHPPHP ^7.4|^8.0.2CI passing

Since Jan 26Pushed 3w ago3 watchersCompare

[ Source](https://github.com/bueltge/marksimple)[ Packagist](https://packagist.org/packages/bueltge/marksimple)[ Fund](https://bueltge.de/impressum/#hinweis)[ GitHub Sponsors](https://github.com/bueltge)[ RSS](/packages/bueltge-marksimple/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (4)Versions (6)Used By (0)

MarkSimple
==========

[](#marksimple)

[![CI](https://github.com/bueltge/marksimple/workflows/CI/badge.svg)](https://github.com/bueltge/marksimple/actions)[![Maintainability](https://camo.githubusercontent.com/cb5f4e3df4aae48776e0ce5c430644d25dc8fd2dd34ab6379cbaa586bc95eb40/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33636537396337623431313863343739353163632f6d61696e7461696e6162696c697479 "Maintainability")](https://codeclimate.com/github/bueltge/marksimple/maintainability)[![Code Coverage](https://camo.githubusercontent.com/2d716bc673eb8deb4dcd53c6f4f8902eb500760b5783a99237a7740d2af271a8/68747470733a2f2f636f6465636f762e696f2f67682f6275656c7467652f6d61726b73696d706c652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/bueltge/marksimple)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/66f442b8abbb164d7a38d3792873e851640fc051d3fe23ddb2c8a2a2e8c60c15/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6275656c7467652f6d61726b73696d706c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bueltge/marksimple/?branch=master)

A simple Markdown parser, short and only with the rules there I currently need. The function is regex based and it is possible to enhance your custom rules.

---

Yes, **I know**, it give a lot of **open projects** that solve the same goal. However it was fun to write my custom parser, only with the rules there I need, not to much overhead. Yes, also I mean that other packages more solid solid, lof of usages, bot not points enough to learn about regex and markdown. Besides *I know* a regex parser is not the best, fastest way, but also here, *I would to teach me in this context*.

Demo, Tests
-----------

[](#demo-tests)

The solution is still active in his tests, you find it [here](https://bueltge.de/thueringen-erfahren/). This test of the class is also build as [PWA](https://developers.google.com/web/progressive-web-apps/), Progressive Web App. It was only an fun project for me to understand it on a really simple site how it works. But is important, if you see the directory `test` in this repository here and wounder about so much files there are not in the context of the Markdown parser. If you will check the PWA, use it on your mobile or play with Chrome/WebInspector.

Active use
----------

[](#active-use)

The class is simple and I use it for my own documentation, there I write in markdown. Here and there is the result a single oage to help in each day to find the right syntax, hints, background and others. You can see this on this examples:

- [MarkSimple Tests](https://bueltge.de/marksimple/test/)
- [My Git Notes](https://bueltge.de/git/)
- [My Markdown Notes](https://bueltge.de/md/)
- [My Linux command notes](https://bueltge.de/linux/)
- [Thüringen erfahren - a one pager for a bicycle event](https://bueltge.de/thueringen-erfahren/)

Support
-------

[](#support)

My class supports currently the follow syntax. But Pull Request are really welcome and the solution give you the possibility to add your own rule.

- Headers, `h1` - `h6` - `#` to `######` before the string
- Image, `![](path/to/image.png "Alt text")`
- Strong, bold text, `strong` - `**` or `__` before and after the string
- Italic text, `em` - an `*` or `_` before and after the string
- Unordered list, `ul` - `*` for each line
- Inline Code, `code` - an ``` backtick before and after the code string
- Code Blocks, `pre` - `    ` (4 spaces) or `	` (tab) in each line or the fenced code blocks by placing triple backticks and optional the language identifier,
- Links, `a` - `[Link Text](Link URL)`
- Horizontal line, `---`
- Break, new line, ``

Usage
-----

[](#usage)

#### Requirements

[](#requirements)

- PHP 7.4

Install static via download, clone the repository or use dependency management via Composer

```
composer require bueltge/marksimple

```

You find the solution and the tests in the [repository on GitHub](https://github.com/bueltge/marksimple).

See the test directory for an example with two different usages. The test directory works as PWA, for examples see only the file `index.php`.

#### Code examples

[](#code-examples)

```
// Example with four spaces.
require_once '../vendor/autoload.php';
use Bueltge\Marksimple\Marksimple;
$ms = new Marksimple();
print $ms->parseFile('../README.md');

```

```
// Example Github Code Block ```php.
require_once '../vendor/autoload.php';
use Bueltge\Marksimple\Marksimple;
$ms = new Marksimple();
print $ms->parseFile('../README.md');
```

#### Add Logger examples

[](#add-logger-examples)

The `MarkSimple` class instance uses the `psr/log` feature.

And the default `Logger` is the `NullLogger` it will be created when declaring `MarkSimple` class instance. The more details about `psr/log`, please visit this [link](https://www.php-fig.org/psr/psr-3/).

```
$testee = new Marksimple();
echo get_class($testee->logger()); //output: Psr\Log\NullLogger
```

Kudos
-----

[](#kudos)

On the way to the goal of my simple parser I use lot of tests, tries on the online Regex testers. Thanks a lot to the authors of this followed two sites, great!

- [PHP Live Regex](https://www.phpliveregex.com/) Really helpful in PHP context.
- [regular expressions 101](https://regex101.com/)
- [DebuggexBeta](https://www.debuggex.com/)
- [Learn Regex The Easy Way](https://github.com/zeeshanu/learn-regex)
- [RegExr](https://regexr.com/)

License
-------

[](#license)

Copyright (c) 2017 until now, [Frank Bültge](https://bueltge.de)

Good news, this plugin is free for everyone! Since it's released under the [MIT License](https://github.com/inpsyde/marksimple/blob/master/LICENSE) you can use it free of charge on your personal or commercial website.

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

[](#contributing)

- [GitHub Repository](https://github.com/bueltge/marksimple)

All feedback / bug reports / pull requests are welcome.

---

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance60

Regular maintenance activity

Popularity28

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 87.2% 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 ~523 days

Total

4

Last Release

1458d ago

Major Versions

1.0.0 → 2.0.02018-09-16

PHP version history (2 changes)1.0.0PHP &gt;=7

2.2.0PHP ^7.4|^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fa321f6c73e14c16d4aea0276673ce1e5d001e49062e32f3b8dc91f0ed10c1e?d=identicon)[bueltge](/maintainers/bueltge)

---

Top Contributors

[![bueltge](https://avatars.githubusercontent.com/u/133425?v=4)](https://github.com/bueltge "bueltge (313 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (9 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (9 commits)")[![Kaishiyoku](https://avatars.githubusercontent.com/u/5131112?v=4)](https://github.com/Kaishiyoku "Kaishiyoku (4 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![Chrico](https://avatars.githubusercontent.com/u/3417446?v=4)](https://github.com/Chrico "Chrico (1 commits)")

---

Tags

markdownmarkdown-parserphpprogressive-web-apppwaphpparsermarkdown

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bueltge-marksimple/health.svg)

```
[![Health](https://phpackages.com/badges/bueltge-marksimple/health.svg)](https://phpackages.com/packages/bueltge-marksimple)
```

###  Alternatives

[league/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)

2.9k404.0M702](/packages/league-commonmark)[simplehtmldom/simplehtmldom

A fast, simple and reliable HTML document parser for PHP.

1921.3M14](/packages/simplehtmldom-simplehtmldom)[corveda/php-sandbox

A PHP library that can be used to run PHP code in a sandboxed environment

23483.5k2](/packages/corveda-php-sandbox)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[leonelquinteros/php-toml

PHP parser for TOML language ( https://github.com/toml-lang/toml )

266.7k](/packages/leonelquinteros-php-toml)

PHPackages © 2026

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