mirror of
https://github.com/flarum/framework.git
synced 2025-01-21 21:27:15 +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 { override } from 'flarum/extend';
|
||||||
import app from 'flarum/app';
|
import app from 'flarum/app';
|
||||||
import Post from 'flarum/models/Post';
|
import Post from 'flarum/models/Post';
|
||||||
import Formatter from 'flarum/utils/Formatter';
|
|
||||||
|
|
||||||
app.initializers.add('emoji', () => {
|
app.initializers.add('emoji', () => {
|
||||||
override(Post.prototype, 'contentHtml', original => {
|
override(Post.prototype, 'contentHtml', original => {
|
||||||
return twemoji.parse(original());
|
return twemoji.parse(original());
|
||||||
});
|
});
|
||||||
|
|
||||||
override(Formatter, 'format', (original, text) => {
|
override(s9e.TextFormatter, 'preview', (original, text, element) => {
|
||||||
return twemoji.parse(original(text));
|
original(text, element);
|
||||||
|
|
||||||
|
twemoji.parse(element);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user