import {Pipe, PipeTransform} from '@angular/core';
// import {ElectronUtil} from '../util/ElectronUtil';

declare const APP_PATH;
// const isInElectron = localStorage.getItem('electron');

@Pipe({
  name: 'contents'
})
export class ContentsPipe implements PipeTransform {

  transform(contents?: string, brNumber = 1): string {
    if (!contents) {
      return '';
    }
    return contents.replace(/\n+/gm,'<br/>'.repeat(brNumber));
  }

}
