Skip to content

Port to league/commonmark 2 - #5

Merged
AydinHassan merged 5 commits into
masterfrom
commonmark-2
Oct 22, 2026
Merged

AydinHassan merged 5 commits into
masterfrom
commonmark-2

Conversation

@AydinHassan

Copy link
Copy Markdown
Member

Moves the renderer from league/commonmark 1.x (10 security advisories, blocks installs on current Composer) to commonmark ^2.8. Intended release: 4.0.0.

Rendered output is unchanged. test/res/e2e/1.expected is untouched and still passes.

Breaking changes

  • PHP ^8.1 (was >=7.1), league/commonmark ^2.8, php-school/keylighter ^0.8.5
  • CliBlockRendererInterface / CliInlineRendererInterface now extend commonmark's NodeRendererInterface. render() is (Node $node, ChildNodeRendererInterface $childRenderer): string, and the $inTightList param is gone.
  • CliRenderer implements ChildNodeRendererInterface and takes a commonmark 2 EnvironmentInterface. renderBlock()/renderInline() take Node.
  • CliExtension is a ConfigurableExtensionInterface with a renderer config schema (renderer.width must be an int, default 30)
  • Callers use Environment + MarkdownParser instead of DocParser

Other

  • PHPUnit 10.5–12, PHPStan 2 (level max, no errors), PHPCS PSR12
  • CI: PHP 8.1 and 8.5 (lowest/highest), job timeout, --stop-on-error, superseded runs cancelled. The dead codecov step is removed.

Verified locally: PHP 8.5 (40 tests OK, phpcs and PHPStan clean) and PHP 8.1 with 8.1-resolved deps (40 tests OK, phpcs and PHPStan clean).

Only dependent is php-school/php-workshop. It will be ported to this API on its docker-fixes branch.

🤖 Generated with Claude Code

AydinHassan and others added 5 commits October 22, 2026 13:29
CliRenderer now implements ChildNodeRendererInterface, the Cli*RendererInterface
interfaces extend NodeRendererInterface and CliExtension is a
ConfigurableExtensionInterface (registers the 'renderer' config schema).
Rendered output is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AydinHassan
AydinHassan merged commit 6254a3d into master Oct 22, 2026
5 checks passed
@AydinHassan
AydinHassan deleted the commonmark-2 branch October 22, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant