Skip to content
Snippets Groups Projects
Unverified Commit 456705a3 authored by kabo2468's avatar kabo2468 Committed by GitHub
Browse files

fix: 引用内の文章をnyaizeをしないように (#9141)


* fix nyaize in quote

* Update CHANGELOG.md

* for ofのほうが早いらしい

* Update NoteEntityService.ts

Co-authored-by: default avatarsyuilo <Syuilotan@yahoo.co.jp>
parent 746fac0d
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ You should also include the user name that made the change.
### Improvements
### Bugfixes
- Server: 引用内の文章がnyaizeされてしまう問題を修正 @kabo2468
- Server: Bug fix for Pinned Users lookup on instance @squidicuzz
- Client: インスタンスティッカーのfaviconを読み込む際に偽サイト警告が出ることがあるのを修正 @syuilo
......
......@@ -329,12 +329,20 @@ export class NoteEntityService implements OnModuleInit {
if (packed.user.isCat && packed.text) {
const tokens = packed.text ? mfm.parse(packed.text) : [];
mfm.inspect(tokens, node => {
function nyaizeNode(node: mfm.MfmNode) {
if (node.type === 'quote') return;
if (node.type === 'text') {
// TODO: quoteなtextはskip
node.props.text = nyaize(node.props.text);
}
});
if (node.children) {
for (const child of node.children) {
nyaizeNode(child);
}
}
}
for (const node of tokens) {
nyaizeNode(node);
}
packed.text = mfm.toString(tokens);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment