MFMをテキストに戻す (#6131)

* Disable Nyaize in quote

* mfmを文字列に戻す、nyaizeにmfmを使用

* Revert "Disable Nyaize in quote"

This reverts commit 1b238905a5535267d32d7e1aec8afd8bb07b0619.

* refactor

* use return type as string
This commit is contained in:
Oni-Men
2020-03-06 22:51:50 +09:00
committed by GitHub
parent 20ac7e62e9
commit a471e4b783
3 changed files with 117 additions and 36 deletions

View File

@ -1,12 +1,13 @@
import { EntityRepository, Repository, In } from 'typeorm';
import { Note } from '../entities/note';
import { User } from '../entities/user';
import { nyaize } from '../../misc/nyaize';
import { Emojis, Users, PollVotes, DriveFiles, NoteReactions, Followings, Polls } from '..';
import { ensure } from '../../prelude/ensure';
import { SchemaType } from '../../misc/schema';
import { awaitAll } from '../../prelude/await-all';
import { convertLegacyReaction, convertLegacyReactions } from '../../misc/reaction-lib';
import { toString } from '../../mfm/toString';
import { parse } from '../../mfm/parse';
export type PackedNote = SchemaType<typeof packedNoteSchema>;
@ -217,7 +218,8 @@ export class NoteRepository extends Repository<Note> {
});
if (packed.user.isCat && packed.text) {
packed.text = nyaize(packed.text);
const tokens = packed.text ? parse(packed.text) : [];
packed.text = toString(tokens, { doNyaize: true });
}
if (!opts.skipHide) {