mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
8 lines
263 B
JavaScript
8 lines
263 B
JavaScript
|
import Ember from 'ember';
|
||
|
|
||
|
export function highlightedText([text, termToHighlight]) {
|
||
|
return Ember.String.htmlSafe(text.replace(new RegExp(termToHighlight, 'ig'), '<span class="highlight">$&</span>'));
|
||
|
}
|
||
|
|
||
|
export default Ember.Helper.helper(highlightedText);
|