Update for live preview refactor

This commit is contained in:
Toby Zerner 2015-07-28 16:06:37 +09:30
parent 6527868924
commit cb358a9084

View File

@ -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);
}); });
}); });