author | ymh <ymh.work@gmail.com> |
Wed, 08 Feb 2017 15:25:24 +0100 | |
changeset 502 | 74fba571487e |
permissions | -rw-r--r-- |
502
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
import Ember from 'ember'; |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
|
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
export function newlinesBr(params) { |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
const param = params[0]; |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
let text = Ember.Handlebars.Utils.escapeExpression(param); |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
text = text.replace(/(\r\n|\n|\r)/gm, '<br>'); |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
return Ember.String.htmlSafe(text); |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
} |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
|
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
export default Ember.Helper.helper(newlinesBr); |