Preview
(zerosonesfun/flarum-preview)
Live preview for the Flarum composer. The textarea is always the source of truth (raw Markdown/BBCode) with this method. This helps ensure that there are no conflicts or issues in general since the original markdown is always what is saved, just like the default composer. Preview is either a split panel below the textarea or a full toggle via the eye button (change in settings).

Above is the default split view. You may collapse it and if there is enough space, drag up on the preview header for a larger preview space. You may need to first drag up on the composer handle, make the composer as a whole taller, and then you may also make the preview taller.
How it works
Some Developer Notes
Split view (default): The composer body is wrapped: textarea in the top portion, a preview panel below. The panel shows server-rendered HTML; you can expand/collapse it by tapping its header.
Server preview: Content is sent to POST /api/preview (same pipeline as Flarum’s TextFormatter: Markdown + BBCode + extensions). The extension registers this route and uses Flarum’s Formatter to parse and render.
Client tokenizer: A small client-side tokenizer recognizes common Markdown (headings, bold, italic, code, lists, links, images, blockquotes). It is used only to detect default toolbar templates (e.g. [link](https://), **bold**) and avoid rendering them until the user edits the placeholder.
Install
Install via Composer:
cd /path/to/flarum
composer require zerosonesfun/flarum-preview:"*"
Clear cache and enable in Admin:
php flarum cache:clear
Then Administration → Extensions → Preview → Enable.
License
MIT. See LICENSE.
Links