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.
- PHP 8.3+
- Composer
composer require markforge/markforgeSee CHANGELOG.md.
<?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.
- headings
- bold
- italic
- links
- inline code
- horizontal rule
- blockquote
- lists (nested, multiline items, tight/loose)
- fenced code blocks
- tables
- images
- strikethrough
- paragraphs
- text
composer install
composer test- 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.
src/
AST/
Exceptions/
Nodes/
Parser/
Renderer/
Tokenizer/
tests/
This project is a Markdown renderer. If you render untrusted user input, you must review the HTML output security implications carefully.