Commit f9aed8f 1 parent cd7f727 commit f9aed8f Copy full SHA for f9aed8f
File tree 2 files changed +5
-1
lines changed
packages/backend/src/core
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 15
15
- 鍵アカウントユーザーか
16
16
- 「アカウントを見つけやすくする」が有効なユーザーか
17
17
- Fix: Play作成時に設定した公開範囲が機能していない問題を修正
18
+ - Fix: 正規化されていない状態のhashtagが連合されてきたhtmlに含まれているとhashtagが正しくhashtagに復元されない問題を修正
18
19
19
20
### Client
20
21
- Feat: アップロードするファイルの名前をランダム文字列にできるように
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { Window } from 'happy-dom';
10
10
import { DI } from '@/di-symbols.js' ;
11
11
import type { Config } from '@/config.js' ;
12
12
import { intersperse } from '@/misc/prelude/array.js' ;
13
+ import { normalizeForSearch } from '@/misc/normalize-for-search.js' ;
13
14
import type { IMentionedRemoteUsers } from '@/models/Note.js' ;
14
15
import { bindThis } from '@/decorators.js' ;
15
16
import * as TreeAdapter from '../../node_modules/parse5/dist/tree-adapters/default.js' ;
@@ -33,6 +34,8 @@ export class MfmService {
33
34
// some AP servers like Pixelfed use br tags as well as newlines
34
35
html = html . replace ( / < b r \s ? \/ ? > \r ? \n / gi, '\n' ) ;
35
36
37
+ const normalizedHashtagNames = hashtagNames == null ? undefined : new Set < string > ( hashtagNames . map ( x => normalizeForSearch ( x ) ) ) ;
38
+
36
39
const dom = parse5 . parseFragment ( html ) ;
37
40
38
41
let text = '' ;
@@ -85,7 +88,7 @@ export class MfmService {
85
88
const href = node . attrs . find ( x => x . name === 'href' ) ;
86
89
87
90
// ハッシュタグ
88
- if ( hashtagNames && href && hashtagNames . map ( x => x . toLowerCase ( ) ) . includes ( txt . toLowerCase ( ) ) ) {
91
+ if ( normalizedHashtagNames && href && normalizedHashtagNames . has ( normalizeForSearch ( txt ) ) ) {
89
92
text += txt ;
90
93
// メンション
91
94
} else if ( txt . startsWith ( '@' ) && ! ( rel && rel . value . startsWith ( 'me ' ) ) ) {
You can’t perform that action at this time.
0 commit comments