UNPKG

413 BPlain TextView Raw
1import { IHtmlEngineHelper } from './html-engine-helper.interface';
2import * as Handlebars from 'handlebars';
3
4export class BreakCommaHelper implements IHtmlEngineHelper {
5 constructor(private bars) {}
6
7 public helperFunc(context: any, text: string) {
8 text = this.bars.Utils.escapeExpression(text);
9 text = text.replace(/,/g, ',<br>');
10 return new Handlebars.SafeString(text);
11 }
12}