定制 fof/rich-text 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fof/rich-text

Composer 安装命令:

composer require fof/rich-text

包简介

Rich Text Editor for Flarum

关键字:

README 文档

README

License Latest Stable Version Total Downloads OpenCollective

A Flarum extension. Fully integrated WYSIWYG Rich Text Editor for Flarum, powered by Tiptap (built on ProseMirror).

Screenshot

Installation

composer require fof/rich-text:*

Updating

composer update fof/rich-text

FAQ

What does it support?

By default, everything from the s9e/TextFormatter Litedown syntax except indented code blocks and underlined 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.

Custom syntax supported out of the box:

  • Spoiler blocks>! text
  • Inline spoilers||text||
  • Math blocks$$ ... $$
  • Inline math$text$
  • Subscript~text~
  • Superscript^text^

Does it work with mentions, emoji, and fof/upload?

Yes. The extension implements Flarum's EditorDriverInterface and is fully compatible with flarum/mentions, flarum/emoji, and fof/upload.

Can users opt out?

Yes. Users can disable the rich text editor from their settings page. You can also enable the Toggle Button setting in the admin dashboard to show a toggle button directly inside the composer.

What about bundle size?

Version 2.x ships the editor as a lazy-loaded async chunk. The Tiptap editor code (~520 KB minified, ~150 KB gzipped) is only downloaded when a user opens the composer. The main forum bundle contributed by this extension is under 13 KB.

This is a significant improvement over 1.x, where ~350 KB was added to every page load.

Is it extensible?

Yes. The extension exposes two main extension points for third-party developers:

Add toolbar buttons:

import { extend } from 'flarum/common/extend';

extend(fof.richText.components.TiptapMenu.prototype, 'items', function (items) {
  items.add('myButton', MyButton.component({ editor: this.attrs.editor }), 10);
});

Add Tiptap extensions to the editor:

import { extend } from 'flarum/common/extend';

extend(fof.richText.tiptap.TiptapEditorDriver.prototype, 'buildExtensions', function (items) {
  items.add('myExtension', MyTiptapExtension);
});

What's it built on?

Version 2.x is built on Tiptap 3 (which runs ProseMirror underneath). The markdown serialization layer uses a custom prosemirror-markdown-based parser and serializer, ensuring faithful roundtrip compatibility with s9e/TextFormatter's output.

Is it a bundled extension?

No. This extension is published and maintained by the Friends of Flarum community.

Links

统计信息

  • 总下载量: 3.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: TypeScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固