refactor: filter anchor link in setting description when searching (#428) (#430)

(cherry picked from commit 98a6322c11df365b3b66511d9a7b03bb0c1fbcf8)

Signed-off-by: Andy Lee <andy.lee@suse.com>
Co-authored-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
mergify[bot] 2025-07-28 18:26:19 +08:00 committed by GitHub
parent 1852e434f1
commit e0c6e905a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -98,8 +98,12 @@ export default {
return true; return true;
} }
const description = this.t(setting.description, this.getDocLinkParams(setting) || {}, true)?.toLowerCase() || ''; let description = this.t(setting.description, this.getDocLinkParams(setting) || {}, true)?.toLowerCase() || '';
// remove <a> tags from description
if (description.includes('<a')) {
description = description.replace(/<a[^>]*>(.*?)<\/a>/g, '$1');
}
// filter by description // filter by description
if (description.includes(searchQuery)) { if (description.includes(searchQuery)) {
return true; return true;