FIX: Escape topic titles when `use_pg_headlines_for_excerpt` true (#24608)
This commit is contained in:
parent
9576f3ec97
commit
9a909758ac
|
@ -8,7 +8,7 @@
|
|||
@result.topic_title_headline
|
||||
)
|
||||
}}
|
||||
<span>{{replace-emoji @result.topic_title_headline}}</span>
|
||||
<span>{{replace-emoji (html-safe @result.topic_title_headline)}}</span>
|
||||
{{else}}
|
||||
<SearchMenu::HighlightedSearch @string={{@result.topic.fancyTitle}} />
|
||||
{{/if}}
|
||||
|
|
|
@ -556,6 +556,20 @@ acceptance("Search - Glimmer - Authenticated", function (needs) {
|
|||
);
|
||||
});
|
||||
|
||||
test("topic results - search result escapes html in topic title when use_pg_headlines_for_excerpt is true", async function (assert) {
|
||||
this.siteSettings.use_pg_headlines_for_excerpt = true;
|
||||
await visit("/");
|
||||
await click("#search-button");
|
||||
await fillIn("#search-term", "dev");
|
||||
await triggerKeyEvent("#search-term", "keyup", "Enter");
|
||||
|
||||
assert
|
||||
.dom(
|
||||
".search-menu .search-result-topic .item:first-of-type .topic-title span.search-highlight"
|
||||
)
|
||||
.exists("html in the topic title is properly escaped");
|
||||
});
|
||||
|
||||
test("search menu keyboard navigation", async function (assert) {
|
||||
const container = ".search-menu .results";
|
||||
await visit("/");
|
||||
|
|
|
@ -84,6 +84,7 @@ export default {
|
|||
yours: false,
|
||||
topic_id: 2179,
|
||||
topic_slug: "development-mode-super-slow",
|
||||
topic_title_headline: "<span class='search-highlight'>Dev</span>opment mode super slow",
|
||||
display_username: "Bill Dudney",
|
||||
primary_group_name: null,
|
||||
version: 2,
|
||||
|
|
Loading…
Reference in New Issue