mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 17:02:45 +08: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="topic">
|
||||
<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>
|
||||
|
||||
<div class="search-category">
|
||||
|
|
|
@ -112,7 +112,7 @@ const Post = RestModel.extend({
|
|||
},
|
||||
|
||||
@discourseComputed("topic_title_headline")
|
||||
topicTitleHead(title) {
|
||||
topicTitleHeadline(title) {
|
||||
return fancyTitle(title, this.siteSettings.support_mixed_text_direction);
|
||||
},
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
{{topic-status topic=result.topic disableActions=true showPrivateMessageIcon=true}}
|
||||
<span class="topic-title">
|
||||
{{#if result.useTopicTitleHeadline}}
|
||||
{{html-safe result.topicTitleHead}}
|
||||
{{html-safe result.topicTitleHeadline}}
|
||||
{{else}}
|
||||
{{#highlight-search highlight=q}}
|
||||
{{html-safe result.topic.fancyTitle}}
|
||||
|
|
|
@ -59,7 +59,9 @@ function postResult(result, link, term) {
|
|||
h("span.blurb", [
|
||||
dateNode(result.created_at),
|
||||
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