1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 21:50:50 +02:00

Hello world!

This commit is contained in:
Toby Zerner
2014-12-20 16:56:46 +10:30
commit 74db323f83
279 changed files with 11954 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import Ember from 'ember';
export default Ember.Handlebars.makeBoundHelper(function(text, phrase, options) {
if (phrase) {
var words = phrase.split(' ');
var replacement = function(matched) {
return '<span class="highlight-keyword">'+matched+'</span>';
};
words.forEach(function(word) {
text = text.replace(
new RegExp("\\b"+word+"\\b", 'gi'),
replacement
);
});
}
return new Handlebars.SafeString(text);
});