A markdown preview doesn’t need a client markdown parser. I render the preview server-side (same pipeline used in production), and load it into a Turbo Frame. The editor form includes a frame called preview, and a “Preview” button submits the form to a preview endpoint targeting that frame. The server renders sanitized HTML. This keeps your markdown rendering consistent and avoids XSS foot-guns from client-side parsing. It’s also more maintainable because the preview uses the same helper methods as the show page. In practice, I debounce the preview submission (optional Stimulus), but even without it, this is simple and effective. The key is to keep preview fast; cache expensive parsing if needed.