summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorkabo2468 <28654659+kabo2468@users.noreply.github.com>2022-11-17 09:34:23 +0900
committerGitHub <noreply@github.com>2022-11-17 09:34:23 +0900
commit456705a3d583190e271b5ce4af545b2b5b4c69ee (patch)
tree915f16b4ec3281ced5d34a228e6529ac15edea4d /packages
parentfix typo on CleanRemoteFilesProcessorService (#9171) (diff)
downloadsharkey-456705a3d583190e271b5ce4af545b2b5b4c69ee.tar.gz
sharkey-456705a3d583190e271b5ce4af545b2b5b4c69ee.tar.bz2
sharkey-456705a3d583190e271b5ce4af545b2b5b4c69ee.zip
fix: 引用内の文章をnyaizeをしないように (#9141)
* fix nyaize in quote * Update CHANGELOG.md * for ofのほうが早いらしい * Update NoteEntityService.ts Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages')
-rw-r--r--packages/backend/src/core/entities/NoteEntityService.ts14
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts
index 098f072a51..5605cf8ce6 100644
--- a/packages/backend/src/core/entities/NoteEntityService.ts
+++ b/packages/backend/src/core/entities/NoteEntityService.ts
@@ -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);
}