From 1d2ba8fd52127e83f844558a37f740f5a986ad20 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 7 Aug 2020 10:49:37 +0800 Subject: [PATCH] DEV: No need to highlight search if PG headline generation is used. --- .../javascripts/admin/templates/search-logs-term.hbs | 8 ++++++-- .../discourse/app/templates/full-page-search.hbs | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/admin/templates/search-logs-term.hbs b/app/assets/javascripts/admin/templates/search-logs-term.hbs index 54348aea2e1..50b58ecfc05 100644 --- a/app/assets/javascripts/admin/templates/search-logs-term.hbs +++ b/app/assets/javascripts/admin/templates/search-logs-term.hbs @@ -54,9 +54,13 @@ {{#if result.blurb}} - {{#highlight-search highlight=term}} + {{#if siteSettings.use_pg_headlines_for_excerpt}} {{html-safe result.blurb}} - {{/highlight-search}} + {{else}} + {{#highlight-search highlight=highlightQuery}} + {{html-safe result.blurb}} + {{/highlight-search}} + {{/if}} {{/if}} diff --git a/app/assets/javascripts/discourse/app/templates/full-page-search.hbs b/app/assets/javascripts/discourse/app/templates/full-page-search.hbs index 7d7b70c632f..dedf5bed201 100644 --- a/app/assets/javascripts/discourse/app/templates/full-page-search.hbs +++ b/app/assets/javascripts/discourse/app/templates/full-page-search.hbs @@ -112,9 +112,13 @@ {{#if result.blurb}} - {{#highlight-search highlight=highlightQuery}} + {{#if siteSettings.use_pg_headlines_for_excerpt}} {{html-safe result.blurb}} - {{/highlight-search}} + {{else}} + {{#highlight-search highlight=highlightQuery}} + {{html-safe result.blurb}} + {{/highlight-search}} + {{/if}} {{/if}}