php-collective/symfony-djot
Symfony integration for Djot, the lightweight markup language. Provides bundle configuration, service wiring, and Twig rendering so you can parse and display Djot content in Symfony applications with minimal setup.
Architecture fit
symfony-djot is a thin Symfony bundle around a Djot parser; the value for a Laravel codebase lives in the framework-agnostic converter, not the bundle's DI wiring. Treat it as a library-layer dependency inside our rendering pipeline, not as a framework integration.DjotRenderer seam: source text in, HTML out. That keeps the parser swappable if the 0.x line stalls.Integration feasibility
significant_newlines, soft_break_mode, xhtml) and six extensions are all constructor/config-level, which maps well to a Laravel config file with per-context profiles (e.g. comments, docs, cms).Technical risk
safe_mode default flip. It is a silent output change, not a loud failure. Any content that previously rendered raw HTML will now be escaped, producing visibly mangled pages on upgrade rather than an error.|djot_raw / djot_raw() is the obvious "fix" a developer will reach for when rendering breaks, which reintroduces the XSS exposure the default just closed. This needs an explicit policy before rollout, not after.Key questions
safe_mode: true escape raw HTML, strip it, or render it inertly? The answer determines whether upgrade breakage is cosmetic or content-destructive.djot_raw output sanitized in any way, or fully trusted-input-only?Stack fit
Djot::toHtml() facade, and drive configuration from config/djot.php with named profiles. This isolates the package behind our own interface so a future swap (or a fork) is a one-file change.Migration path
safe_mode: false set explicitly to preserve current output, ship the upgrade with zero user-visible change, then flip to the secure default as a deliberate, separately-tested step.djot_raw for a named allowlist of trusted, admin-only fields. Enforce it in the renderer profile, not in templates, so it cannot be reached ad hoc.Compatibility
0.2.0, not ^0.2) given the 0.x cadence, and treat every minor as a potential breaking change requiring the golden-file diff.Sequencing
DjotRenderer seam plus a golden-file test suite over a representative content corpus.safe_mode: false; diff against baseline; expect zero deltas.safe_mode: true; triage every delta; add djot_raw only where an owner signs off.admonition and tabs (high author value, low blast radius), defer inline_footnotes and heading_reference until authoring docs exist.xhtml and soft_break_mode only if a concrete consumer (email rendering, feed output) requires them; otherwise leave defaults.Maintenance
Support
djot_raw policy and the profile-to-use-case mapping internally; otherwise support requests will resolve to "turn off safe mode," which is the wrong answer.Scaling
Failure modes
djot_raw — a developer "fixes" a rendering break by reaching for the raw filter on user content. Mitigate by scoping djot_raw to renderer profiles, not templates, and by reviewing any PR that adds it.{{ }} around already-rendered HTML, or {!! !!} around unrendered Djot. Mitigate with a single blessed directive and a lint rule.Ramp-up
How can I help you explore Laravel packages today?