FoF Rich Text

A Flarum extension. Fully integrated WYSIWYG Rich Text Editor for Flarum.

Installation
composer require fof/rich-text
Updating
composer update fof/rich-text
FAQ
Is it a bundled extension?
No. This extension is published and maintained by the Friends of Flarum community. The editor driver is part of Flarum's public API, so it shouldn't experience issues with Flarum updates for the foreseeable future.
What does it support?
By default, everything from the s9e/TextFormatter Litedown syntax except indented code blocks and lines under headers. The tables and checklists extensions add support for PipeTables and TaskLists.
BBCodes are not WYSIWYG'd, but their syntax characters won't be escaped so you can still use them.
2.x additionally supports: spoiler blocks (>! text), inline spoilers (||text||), math blocks ($$ ... $$), inline math ($text$), subscript (~text~), and superscript (^text^).
What's it written in?
2.x is built on Tiptap 3 (which runs ProseMirror underneath), with a custom markdown parser and serializer for faithful s9e/TextFormatter compatibility.
1.x was built directly on ProseMirror.
Is it extensible?
Yes. In 2.x, the extension API is clean and straightforward:
// Add a toolbar button
extend(TiptapMenu.prototype, 'items', function (items) {
items.add('myButton', ...);
});
// Add a Tiptap extension to the editor
extend(TiptapEditorDriver.prototype, 'buildExtensions', function (items) {
items.add('myExtension', MyTiptapExtension);
});
In 1.x, ProseMirror was quite challenging to work with β the markdown tables and tasklists extensions were proof of concept of how flexible it was, but required deep ProseMirror knowledge.
Does it work with mentions, emoji, and fof/upload?
Yes.
Can users opt out?
Yes, on their settings page there's a preference. You can also enable a setting in the admin dashboard that will add a toggle directly to the editor.
What about bundle size?
2.x ships the editor as a lazy-loaded async chunk. The Tiptap editor code (520 KB minified) only loads when a user opens the composer. The main forum bundle impact is 12 KB a 97% reduction compared to 1.x for page loads where the composer is never opened.
1.x added 350 KB to every page load regardless of whether the user opened the composer.
Links