hydephp/torchlight-commonmark
Adds Torchlight syntax highlighting to the CommonMark PHP parser. It swaps the default code block renderer so fenced code blocks are sent to Torchlight's API and rendered with highlighting, line numbers, diffs, and other features.
Architecture fit
league/commonmark extension, not a Laravel service provider. It hooks the Environment used to render Markdown and hands fenced code blocks to the Torchlight API. Fit is therefore determined entirely by where our Markdown is rendered, not by our Laravel version.league/commonmark directly, or through wrappers such as spatie/laravel-markdown or HydePHP. Poor fit (near-zero leverage) if content is authored in a CMS with its own renderer, rendered client-side, or already pre-processed into HTML.illuminate/support or the torchlight/torchlight client) excluded Laravel 11. That means adopting this package is adopting a compatibility patch, not a Laravel-native integration.Integration feasibility
Environment. No migrations, no published config in most setups, no queue or event wiring. Engineering effort to a working spike is measured in hours, not days.Technical risk
torchlight/commonmark, the diff is unknown until audited.Key questions
torchlight/commonmark, and has that change been offered upstream as a PR?torchlight/torchlight client version is pinned, and is that the actual source of our conflict?Stack fit
league/commonmark 2.x. Requires an existing server-side Markdown pipeline; if we don't have one, the true cost is introducing commonmark, not this package.Migration path
highlight.php or Shiki: straightforward swap behind the same CommonMark renderer, but we trade a zero-dependency local library for a networked paid service — a deliberate trade that needs a stated justification.torchlight/commonmark: likely a package-name change only, but do a diff audit first and pin an exact version.Compatibility
league/commonmark major version and the Torchlight client's illuminate/* constraints. Verify Laravel 12/PHP 8.4 forward-compatibility before committing, since a stale fork will block framework upgrades.Sequencing
No big-bang requirement; the surface is naturally incremental.
Maintenance
league/commonmark upgrade requires confirming the fork still resolves.Support
Scaling
Failure modes
Ramp-up
Recommendation for decision-makers: treat this as an evaluation of Torchlight-the-service with an unproven, forked integration shim, not as an evaluation of a stable Laravel package. Proceed only if (a) upstream still cannot support Laravel 11+, (b) caching and a degraded-render fallback are designed before pilot, and (c) we accept a realistic path to owning or vendoring the extension. If those conditions are not cheap to satisfy, a local highlighter removes an entire category of operational risk for a fraction of the coordination cost.
How can I help you explore Laravel packages today?