Store texts as HTML

This commit is contained in:
Akihiko Odaki
2018-03-31 19:53:30 +09:00
parent 8c41432907
commit 7da60a0147
31 changed files with 318 additions and 283 deletions

View File

@@ -8,7 +8,6 @@ import { pack as packChannel } from './channel';
import Vote from './poll-vote';
import Reaction from './post-reaction';
import { pack as packFile } from './drive-file';
import parse from '../common/text';
const Post = db.get<IPost>('posts');
@@ -31,6 +30,7 @@ export type IPost = {
repostId: mongo.ObjectID;
poll: any; // todo
text: string;
textHtml: string;
cw: string;
userId: mongo.ObjectID;
appId: mongo.ObjectID;
@@ -103,11 +103,6 @@ export const pack = async (
delete _post.mentions;
if (_post.geo) delete _post.geo.type;
// Parse text
if (_post.text) {
_post.ast = parse(_post.text);
}
// Populate user
_post.user = packUser(_post.userId, meId);