- (feat) add concept of post processors
- (feat) add 'key as default value' post processor (closes #109) - (chore) move clean functionality to a post processor - (chore) move sort functionality to a post processor - (refactor) get rid of leading underscore on protected properties/methods
This commit is contained in:
@@ -5,14 +5,14 @@ import { TranslationCollection } from '../utils/translation.collection';
|
||||
export class PipeParser extends AbstractTemplateParser implements ParserInterface {
|
||||
|
||||
public extract(contents: string, path?: string): TranslationCollection {
|
||||
if (path && this._isAngularComponent(path)) {
|
||||
contents = this._extractInlineTemplate(contents);
|
||||
if (path && this.isAngularComponent(path)) {
|
||||
contents = this.extractInlineTemplate(contents);
|
||||
}
|
||||
|
||||
return this._parseTemplate(contents);
|
||||
return this.parseTemplate(contents);
|
||||
}
|
||||
|
||||
protected _parseTemplate(template: string): TranslationCollection {
|
||||
protected parseTemplate(template: string): TranslationCollection {
|
||||
let collection: TranslationCollection = new TranslationCollection();
|
||||
|
||||
const regExp: RegExp = /(['"`])((?:(?!\1).|\\\1)+)\1\s*\|\s*translate/g;
|
||||
|
Reference in New Issue
Block a user