twig/markdown-extra
Twig extension adding Markdown conversion filters: markdown_to_html to render Markdown as HTML, and html_to_markdown to convert HTML back to Markdown. Useful for templating content workflows where Markdown and HTML need to interoperate.
html_to_markdown filter, reducing manual effort for large-scale content overhauls (e.g., migrating static pages or forum posts to a modern CMS).cebe/markdown or league/commonmark are more appropriate. Encourages evaluating the templating stack before committing to this package.markdown_to_html) and conversion (html_to_markdown) for workflows like content migrations, editing previews, or hybrid authoring tools.html_to_markdown filter can automate this process.league/html-to-markdown.tightenco/jigsaw). For Laravel, prefer cebe/markdown (Blade-compatible) or league/commonmark (direct PHP integration).html_to_markdown is lossy for nested tables, inline styles, or scripts. Test rigorously with real-world content; consider alternatives if round-tripping is essential.html-sanitizer) and careful input validation.league/commonmark (PHP) or cebe/markdown (Blade) for Laravel projects, or Laravel’s built-in Str::markdown() for simple use cases. These have stronger communities and better documentation.For Executives:
"This package allows us to render Markdown content directly in Twig templates, which is particularly useful for internal tools, documentation, or blogs—saving 2–3 weeks of development time compared to building a custom solution. However, it’s only viable for Twig-based projects (like Symfony) and comes with significant red flags: an impossible release date (2026), zero production users, and no maintenance. We recommend using it only for low-risk internal tools with a clear fallback plan. For customer-facing features, we should invest in a maintained alternative like league/commonmark to avoid technical debt and security risks. The tradeoff is clear: short-term speed vs. long-term stability."
For Engineering:
*"If your project uses Twig, this package provides markdown_to_html and html_to_markdown filters out of the box. However:
cebe/markdown or league/commonmark instead.html_to_markdown filter requires league/html-to-markdown, which isn’t auto-installed. Pin versions to avoid conflicts.html-sanitizer for untrusted Markdown to prevent XSS vulnerabilities.league/commonmark as a backup.For Product Managers: *"This is a short-term solution for Twig projects needing Markdown support, but not a long-term bet. Use it for:
league/commonmark for Laravel or new Twig projects. Key risks: security gaps, no maintenance, and Laravel incompatibility. If we adopt this, treat it as a temporary fix with a clear exit strategy."*How can I help you explore Laravel packages today?