FIX: remove word boundary regex (\b) for search result highlights. (#9338)

This commit is contained in:
Vinoth Kannan
2020-04-15 11:11:00 +05:30
committed by GitHub
parent c670a34013
commit 4a2c4232c5
14 changed files with 186 additions and 171 deletions
@@ -1,5 +1,6 @@
import Component from "@ember/component";
import { on } from "discourse-common/utils/decorators";
import highlightHTML from "discourse/lib/highlight-html";
export default Component.extend({
classNames: ["site-text"],
@@ -10,11 +11,13 @@ export default Component.extend({
const term = this._searchTerm();
if (term) {
$(
this.element.querySelector(".site-text-id, .site-text-value")
).highlight(term, {
className: "text-highlight"
});
highlightHTML(
this.element.querySelector(".site-text-id, .site-text-value"),
term,
{
className: "text-highlight"
}
);
}
$(this.element.querySelector(".site-text-value")).ellipsis();
},