mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 10:25:41 +08:00
UX: Standardize tag display in search menu results
This allows theme components (like discourse-tag-icons) to apply to tag results in search menu.
This commit is contained in:
parent
1e9d9d9346
commit
2ab6a68629
@ -6,6 +6,7 @@ import { h } from "virtual-dom";
|
||||
import highlightText from "discourse/lib/highlight-text";
|
||||
import { escapeExpression, formatUsername } from "discourse/lib/utilities";
|
||||
import { iconNode } from "discourse-common/lib/icon-library";
|
||||
import renderTag from "discourse/lib/render-tag";
|
||||
|
||||
class Highlighted extends RawHtml {
|
||||
constructor(html, term) {
|
||||
@ -70,13 +71,7 @@ createSearchResult({
|
||||
linkField: "url",
|
||||
builder(t) {
|
||||
const tag = escapeExpression(t.id);
|
||||
return h(
|
||||
"span",
|
||||
{
|
||||
className: `tag-${tag} discourse-tag ${Discourse.SiteSettings.tag_style}`
|
||||
},
|
||||
tag
|
||||
);
|
||||
return new RawHtml({ html: renderTag(tag, { tagName: "span" }) });
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user