mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-31 13:34:12 +00:00 
			
		
		
		
	fix: 正規化されていない状態のhashtagが連合されてきたhtmlに含まれているとhashtagが正しくhashtagに復元されない問題を修正 (#13733)
This commit is contained in:
		
							parent
							
								
									cd7f7271ca
								
							
						
					
					
						commit
						f9aed8f2bf
					
				
					 2 changed files with 5 additions and 1 deletions
				
			
		|  | @ -15,6 +15,7 @@ | |||
|   - 鍵アカウントユーザーか | ||||
|   - 「アカウントを見つけやすくする」が有効なユーザーか | ||||
| - Fix: Play作成時に設定した公開範囲が機能していない問題を修正 | ||||
| - Fix: 正規化されていない状態のhashtagが連合されてきたhtmlに含まれているとhashtagが正しくhashtagに復元されない問題を修正 | ||||
| 
 | ||||
| ### Client | ||||
| - Feat: アップロードするファイルの名前をランダム文字列にできるように | ||||
|  |  | |||
|  | @ -10,6 +10,7 @@ import { Window } from 'happy-dom'; | |||
| import { DI } from '@/di-symbols.js'; | ||||
| import type { Config } from '@/config.js'; | ||||
| import { intersperse } from '@/misc/prelude/array.js'; | ||||
| import { normalizeForSearch } from '@/misc/normalize-for-search.js'; | ||||
| import type { IMentionedRemoteUsers } from '@/models/Note.js'; | ||||
| import { bindThis } from '@/decorators.js'; | ||||
| import * as TreeAdapter from '../../node_modules/parse5/dist/tree-adapters/default.js'; | ||||
|  | @ -33,6 +34,8 @@ export class MfmService { | |||
| 		// some AP servers like Pixelfed use br tags as well as newlines
 | ||||
| 		html = html.replace(/<br\s?\/?>\r?\n/gi, '\n'); | ||||
| 
 | ||||
| 		const normalizedHashtagNames = hashtagNames == null ? undefined : new Set<string>(hashtagNames.map(x => normalizeForSearch(x))); | ||||
| 
 | ||||
| 		const dom = parse5.parseFragment(html); | ||||
| 
 | ||||
| 		let text = ''; | ||||
|  | @ -85,7 +88,7 @@ export class MfmService { | |||
| 					const href = node.attrs.find(x => x.name === 'href'); | ||||
| 
 | ||||
| 					// ハッシュタグ
 | ||||
| 					if (hashtagNames && href && hashtagNames.map(x => x.toLowerCase()).includes(txt.toLowerCase())) { | ||||
| 					if (normalizedHashtagNames && href && normalizedHashtagNames.has(normalizeForSearch(txt))) { | ||||
| 						text += txt; | ||||
| 					// メンション
 | ||||
| 					} else if (txt.startsWith('@') && !(rel && rel.value.startsWith('me '))) { | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue