mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-12-22 00:10:14 +00:00
fix: 引用内の文章をnyaizeをしないように (#9141)
* fix nyaize in quote * Update CHANGELOG.md * for ofのほうが早いらしい * Update NoteEntityService.ts Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
parent
746fac0dfe
commit
456705a3d5
2 changed files with 12 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue