# thephpleague/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.

Repository: https://github.com/thephpleague/commonmark
Canonical: https://ross.abutalabs.com/products/thephpleague-commonmark
Homepage: https://commonmark.thephpleague.com
Language: PHP
License: BSD-3-Clause
License Family: permissive
Topics: php, commonmark, markdown, github-flavored-markdown, gfm, hacktoberfest
Last push: 2026-08-26T00:05:27+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 97, longevity 100
- inputs: {"age_days": 4378, "days_push": 8, "days_rel": 22, "gap_med": 21.0, "n_releases_24m": 13}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2971, forks 214 (observed 2026-08-28T04:07:32.753584+00:00)

## What it is
league/commonmark is a highly-extensible PHP Markdown parser that fully supports the CommonMark and GitHub-Flavored Markdown specifications. It converts Markdown to HTML via an easy-to-use converter API with built-in extensions, security options, and support for custom syntax and renderers.

## Use cases
- convert markdown to html in php
- parse user-submitted markdown safely
- render github-flavored markdown
- add custom markdown syntax to a php app
- render markdown in a cms or framework
- generate html from markdown documentation files

## When to choose
- you need a spec-compliant CommonMark or GFM parser in PHP
- you need to sanitize untrusted markdown input with html stripping and unsafe link blocking
- you want to extend markdown with custom syntax, renderers, or extensions
- you need integrations with popular PHP frameworks and CMSes

## When to avoid
- your project is not written in PHP
- you only need a lightweight regex-based markdown converter without spec compliance
- you need to parse non-UTF-8/ASCII encodings without converting first

## Facets
- artifact type: library
- maturity: stable
- function: parser, markdown, templating
- domain: web-development, parsers, documentation, developer-tools
- platform: php, cross-platform
- tags: commonmark, gfm, markdown-to-html, extensible-parser, composer

## Member repositories
- thephpleague/commonmark (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:32.753584+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:31:43.855007+00:00, confidence not recorded.
  - readme: https://github.com/thephpleague/commonmark (fetched 2026-08-28T04:07:32.753584+00:00, sha ee593af9b494)
  - homepage: https://commonmark.thephpleague.com (fetched 2026-08-29T09:47:00.028201+00:00, sha 168ddc2510a0)
  - site_page: https://commonmark.thephpleague.com/2.x (fetched 2026-08-29T09:47:00.037607+00:00, sha 072841f08549)
- Data as of 2026-08-30T08:39:29.467469+00:00.
