mirror of
https://github.com/flarum/framework.git
synced 2025-01-21 14:07:47 +08:00
Update for live preview refactor
This commit is contained in:
parent
6527868924
commit
cb358a9084
|
@ -3,14 +3,15 @@
|
|||
import { override } from 'flarum/extend';
|
||||
import app from 'flarum/app';
|
||||
import Post from 'flarum/models/Post';
|
||||
import Formatter from 'flarum/utils/Formatter';
|
||||
|
||||
app.initializers.add('emoji', () => {
|
||||
override(Post.prototype, 'contentHtml', original => {
|
||||
return twemoji.parse(original());
|
||||
});
|
||||
|
||||
override(Formatter, 'format', (original, text) => {
|
||||
return twemoji.parse(original(text));
|
||||
override(s9e.TextFormatter, 'preview', (original, text, element) => {
|
||||
original(text, element);
|
||||
|
||||
twemoji.parse(element);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user