PHPackages                             bredmor/yaro - 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. bredmor/yaro

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

bredmor/yaro
============

Extensible Markdown Parser

0.0.1(7y ago)171[1 PRs](https://github.com/bredmor/yaro/pulls)GPL-3.0-or-laterPHPPHP &gt;=7.2CI failing

Since Mar 28Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/bredmor/yaro)[ Packagist](https://packagist.org/packages/bredmor/yaro)[ Docs](https://github.com/bredmor/yaro)[ RSS](/packages/bredmor-yaro/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Yaro - Light Extensible Markdown Parser for PHP
===============================================

[](#yaro---light-extensible-markdown-parser-for-php)

[![Build Status](https://camo.githubusercontent.com/ae2a0a94b9c5b9a8e0e8a1529487b7df758cc30cdcceca926a14f5f4fdac6cc1/68747470733a2f2f7472617669732d63692e6f72672f627265646d6f722f7961726f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bredmor/yaro)

Yaro is a Parser and Lexer framework meant for Markdown. By Default, Yaro parses **basic** markdown.

Installation / Usage
--------------------

[](#installation--usage)

### From Source:

[](#from-source)

Clone the repository from GitHub or unzip into your vendor directory. Yaro is packaged for [PSR-4](https://www.php-fig.org/psr/psr-4/) autoloading.

### From Composer:

[](#from-composer)

`composer require bredmor/yaro`

### Using in your project:

[](#using-in-your-project)

```
use bredmor\Yaro\Yaro;
$yaro = new Yaro();
echo $yaro->parse("Your *markdown* text here.");

```

### Adding a new markdown token to the default lexer:

[](#adding-a-new-markdown-token-to-the-default-lexer)

```
$lexer = new bredmor\Yaro\Lexer\DefaultLexer();
$lexer->setToken('/Your PCRE-compat regex here/', function($match) {
    // Any closure, function name or preg_* function compatible replacement string can be used for the 2nd argument
});
$yaro = new Yaro($lexer);
echo $yaro->parse("Your custom markdown text here.");

```

### Extensibility

[](#extensibility)

You can either `extend` the default parser or lexer, or implement `LexerInterface` and `ParserInterface` on your own, custom classes.

Just pass either to constructor when initiating it and it will be used instead of the default.

```
$parser = new MyCustomParser();
$yaro = new Yaro(null, $parser); // Using a NULL value for the parser or lexer in the controller will cause Yaro to use the default class.

```

You can also change the parser or lexer of an existing Yaro object at *any* time. This allows you to Inject an already configured Yaro instance and swap contexts on the fly.

```
$yaro = new Yaro();
echo $yaro->parse("My markdown string"); // The string is evaluated using the default lexer
$yaro->setLexer($myOtherLexerClass);
echo $yaro->parse("My other markdown string"); // This string is evaluated using the new lexer

```

Requirements
------------

[](#requirements)

PHP 7.2 or above.

Supported Markdown
------------------

[](#supported-markdown)

Yaro's default lexer supports the following markdown:

\*Italic Emphasis\* with asterisks or underscores

\*\*Bold\*\* with asterisks or underscores

~~Strikethrough~~

\----- Horizonal Rulers

\#Headings

&gt;Blockquotes (&gt;, &gt;, |, &gt;&gt; and »)

``` Code Blocks

` Inline Code

\*Unordered Lists (\*, - and +)

1. Ordered Lists (any number)

\[Links\]()

!\[Embedded Images\](link\_to\_image.png)

Authors
-------

[](#authors)

- Morgan Breden | [GitHub](https://github.com/bredmor) | [Twitter](https://twitter.com/bredmor) |

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

[](#contributing)

Pull requests, bug reports and feature requests are welcome.

License
-------

[](#license)

Yaro is licensed under the GPLv3 License - see the [LICENSE](LICENSE) file for details

Acknowledgements
----------------

[](#acknowledgements)

Yaro is [named after](https://en.wiktionary.org/wiki/%E9%87%8E%E9%83%8E#Japanese) the individual who really wanted me to write another markdown parser specifically for their use case.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance54

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% 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

2605d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8249823?v=4)[Morgan Breden](/maintainers/bredmor)[@bredmor](https://github.com/bredmor)

---

Top Contributors

[![bredmor](https://avatars.githubusercontent.com/u/8249823?v=4)](https://github.com/bredmor "bredmor (15 commits)")[![csalzano](https://avatars.githubusercontent.com/u/938411?v=4)](https://github.com/csalzano "csalzano (1 commits)")

---

Tags

parsermarkdownparsemdparsing

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bredmor-yaro/health.svg)

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

###  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)[erusev/parsedown

Parser for Markdown.

15.0k151.8M732](/packages/erusev-parsedown)[erusev/parsedown-extra

An extension of Parsedown that adds support for Markdown Extra.

84314.8M192](/packages/erusev-parsedown-extra)[jakubledl/dissect

Lexing and parsing in pure PHP

2244.6M11](/packages/jakubledl-dissect)[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)[parsica-php/parsica

The easiest way to build robust parsers in PHP.

412140.4k4](/packages/parsica-php-parsica)

PHPackages © 2026

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