Fix Pipe regex and add test

This commit is contained in:
Kim Biesbjerg
2016-12-20 16:42:05 +01:00
parent 0a4d58c1fa
commit 9d87ff368c
2 changed files with 28 additions and 1 deletions

View File

@@ -15,7 +15,7 @@ export class PipeParser extends AbstractTemplateParser implements ParserInterfac
protected _parseTemplate(template: string): TranslationCollection {
let collection: TranslationCollection = new TranslationCollection();
const regExp = new RegExp(/(['"`])([^\1]*?)\1\s*\|\s*translate/, 'g');
const regExp = new RegExp(/(['"`])([^\1\r\n]*?)\1\s*\|\s*translate/, 'g');
let matches: RegExpExecArray;
while (matches = regExp.exec(template)) {