PHPackages                             phpnomad/markdown - 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. phpnomad/markdown

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

phpnomad/markdown
=================

Interfaces related to adapting and working with markdown and HTML

1.0.1(3w ago)03.1k2MITPHP

Since Jun 6Pushed 3w agoCompare

[ Source](https://github.com/phpnomad/markdown)[ Packagist](https://packagist.org/packages/phpnomad/markdown)[ RSS](/packages/phpnomad-markdown/feed)WikiDiscussions main Synced today

READMEChangelog (2)DependenciesVersions (3)Used By (2)

phpnomad/markdown
=================

[](#phpnomadmarkdown)

[![Latest Version](https://camo.githubusercontent.com/d2d151f3bf0c79f03d2ba67fbb500bbad679ca12da6e96a13eed2adfe3fa153d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f6d61726b646f776e2e737667)](https://packagist.org/packages/phpnomad/markdown)[![Total Downloads](https://camo.githubusercontent.com/fbe2eb00ea88846cac81f40484712f95ccd474a8eef977a015e44f9fdda42f1f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f6d61726b646f776e2e737667)](https://packagist.org/packages/phpnomad/markdown)[![PHP Version](https://camo.githubusercontent.com/e074ac75fc99a269d5fc5e5e2b4584bb9a0b269d3daf4cfbc9f13cbe6b67f4e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f6d61726b646f776e2e737667)](https://packagist.org/packages/phpnomad/markdown)[![License](https://camo.githubusercontent.com/e4ba4c114e05218aced6efef2270e037c753171f7d636e9627b4dd7efcb2ddb7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f6d61726b646f776e2e737667)](https://packagist.org/packages/phpnomad/markdown)

`phpnomad/markdown` defines the contracts PHPNomad applications use to convert between markdown and HTML. It ships two interfaces and a small exception hierarchy, with no concrete logic of its own. Like the rest of PHPNomad, it keeps your consumer code pointed at an abstraction so the underlying library stays swappable. The drop-in implementation lives in `phpnomad/league-markdown-integration`, which bridges these contracts to League CommonMark and league/html-to-markdown.

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

[](#installation)

```
composer require phpnomad/markdown
```

On its own this package provides no conversion logic, so you also need an implementation package bound to the interfaces in your container. `phpnomad/league-markdown-integration` is the canonical one.

Overview
--------

[](#overview)

- `CanConvertMarkdownToHtml` declares `toHtml(string $markdown): string` for turning markdown source into an HTML string, throwing `ConvertToHtmlException` on failure.
- `CanConvertHtmlToMarkdown` declares `toMarkdown(string $html): string` for the reverse direction, throwing `ConvertToMarkdownException` on failure.
- `MarkdownException` is the base exception that both conversion failures extend, so a single catch block can handle any markdown conversion error in your application.
- Because both conversion directions are separate interfaces, a binding can implement one, the other, or both. A read-only renderer never has to pull in HTML-to-markdown machinery it will not use.
- Consumers type-hint against the interfaces rather than any concrete class. Swapping the implementation is a container binding change, not a refactor.

Documentation
-------------

[](#documentation)

Full documentation lives at [phpnomad.com](https://phpnomad.com).

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

43

↑

FairBetter than 89% of packages

Maintenance95

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

Total

2

Last Release

22d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e6206223bd6f2a57b8ac80605b1b5c3521faaec18ad3f20f25fb728a9a13784?d=identicon)[tstandiford](/maintainers/tstandiford)

---

Top Contributors

[![alexstandiford](https://avatars.githubusercontent.com/u/8210827?v=4)](https://github.com/alexstandiford "alexstandiford (6 commits)")

---

Tags

frameworkhtmlmarkdownphpphpnomadplatform-agnostic

### Embed Badge

![Health badge](/badges/phpnomad-markdown/health.svg)

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[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.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

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

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

PHPackages © 2026

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