mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Expose PG headline highlighting for all search results.
This commit is contained in:
parent
603a4d1794
commit
808e84a856
@ -31,7 +31,16 @@
|
|||||||
<div class="fps-topic">
|
<div class="fps-topic">
|
||||||
<div class="topic">
|
<div class="topic">
|
||||||
<a href={{result.url}} class="search-link">
|
<a href={{result.url}} class="search-link">
|
||||||
{{topic-status topic=result.topic disableActions=true}}<span class="topic-title">{{#highlight-search highlight=term}}{{html-safe result.topic.fancyTitle}}{{/highlight-search}}</span>
|
{{topic-status topic=result.topic disableActions=true}}
|
||||||
|
<span class="topic-title">
|
||||||
|
{{#if result.useTopicTitleHeadline}}
|
||||||
|
{{html-safe result.topicTitleHeadline}}
|
||||||
|
{{else}}
|
||||||
|
{{#highlight-search highlight=q}}
|
||||||
|
{{html-safe result.topic.fancyTitle}}
|
||||||
|
{{/highlight-search}}
|
||||||
|
{{/if}}
|
||||||
|
</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="search-category">
|
<div class="search-category">
|
||||||
|
@ -112,7 +112,7 @@ const Post = RestModel.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed("topic_title_headline")
|
@discourseComputed("topic_title_headline")
|
||||||
topicTitleHead(title) {
|
topicTitleHeadline(title) {
|
||||||
return fancyTitle(title, this.siteSettings.support_mixed_text_direction);
|
return fancyTitle(title, this.siteSettings.support_mixed_text_direction);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
{{topic-status topic=result.topic disableActions=true showPrivateMessageIcon=true}}
|
{{topic-status topic=result.topic disableActions=true showPrivateMessageIcon=true}}
|
||||||
<span class="topic-title">
|
<span class="topic-title">
|
||||||
{{#if result.useTopicTitleHeadline}}
|
{{#if result.useTopicTitleHeadline}}
|
||||||
{{html-safe result.topicTitleHead}}
|
{{html-safe result.topicTitleHeadline}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#highlight-search highlight=q}}
|
{{#highlight-search highlight=q}}
|
||||||
{{html-safe result.topic.fancyTitle}}
|
{{html-safe result.topic.fancyTitle}}
|
||||||
|
@ -59,7 +59,9 @@ function postResult(result, link, term) {
|
|||||||
h("span.blurb", [
|
h("span.blurb", [
|
||||||
dateNode(result.created_at),
|
dateNode(result.created_at),
|
||||||
h("span", " - "),
|
h("span", " - "),
|
||||||
new Highlighted(result.blurb, term)
|
this.siteSettings.use_pg_headlines_for_excerpt
|
||||||
|
? new RawHtml({ html: `<span>${result.blurb}</span>` })
|
||||||
|
: new Highlighted(result.blurb, term)
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user