This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/highlight-text.js
David Taylor d62d258fe5
Revert "FIX: word boundary regex (\b) not working in Unicode languages. (#9163)"
Lookbehind regex is not supported in Firefox or IE11

This reverts commit 572bb5988f.
2020-03-25 14:34:45 +00:00

14 lines
328 B
JavaScript

import Component from "@ember/component";
import highlightText from "discourse/lib/highlight-text";
export default Component.extend({
tagName: "span",
_highlightOnInsert: function() {
const term = this.highlight;
highlightText($(this.element), term);
}
.observes("highlight")
.on("didInsertElement")
});