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

(cherry picked from commit 98a6322c11)

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
co-authored by Andy Lee
parent 1852e434f1
commit e0c6e905a9
+5 -1
View File
@@ -98,8 +98,12 @@ export default {
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
if (description.includes(searchQuery)) {
return true;