import Ember from 'ember';

export function newlinesBr(params) {
  const param = params[0];
  let text = Ember.Handlebars.Utils.escapeExpression(param);
  text = text.replace(/(\r\n|\n|\r)/gm, '<br>');
  return Ember.String.htmlSafe(text);
}

export default Ember.Helper.helper(newlinesBr);
