markforge / markforge
MarkForge — Markdown to HTML parser for PHP 8.3+ (AST-based, extensible).
v0.2.0
2026-04-12 07:35 UTC
Requires
- php: >=8.3
Requires (Dev)
- phpunit/phpunit: ^11.0
README
MarkForge is an open-source Markdown to HTML parser for PHP 8.3+.
This repository currently contains a minimal, working pipeline (Tokenizer → Parser → AST → Renderer) with incremental feature development.
Requirements
- PHP 8.3+
- Composer
Installation
composer require markforge/markforge
Changelog
See CHANGELOG.md.
Usage
<?php require __DIR__ . '/../vendor/autoload.php'; $parser = new MarkForge\MarkForge(); $html = $parser->parse("Hello, world!\n\nSecond paragraph."); echo $html;
See also: examples/basic.php.
Supported Markdown (current)
- headings
- bold
- italic
- links
- inline code
- horizontal rule
- blockquote
- lists (nested, multiline items, tight/loose)
- fenced code blocks
- tables
- images
- strikethrough
- paragraphs
- text
Running tests
composer install
composer test
Release / Packagist
- Publish the repository on GitHub (source: https://github.com/Smiley-Alyx/markforge).
- Create a semver tag (e.g.
v0.1.0). - Submit the repository to Packagist so
composer require markforge/markforgeworks without VCS configuration.
Project structure
src/
AST/
Exceptions/
Nodes/
Parser/
Renderer/
Tokenizer/
tests/
Security
This project is a Markdown renderer. If you render untrusted user input, you must review the HTML output security implications carefully.