cms/app-client/app/helpers/newlines-br.js
author ymh <ymh.work@gmail.com>
Wed, 08 Feb 2017 15:25:24 +0100
changeset 502 74fba571487e
permissions -rw-r--r--
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746

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);