diff --git a/modules/@angular/compiler/src/i18n/serializers/xmb.ts b/modules/@angular/compiler/src/i18n/serializers/xmb.ts index 1df69b7ad1..3834ee3938 100644 --- a/modules/@angular/compiler/src/i18n/serializers/xmb.ts +++ b/modules/@angular/compiler/src/i18n/serializers/xmb.ts @@ -119,11 +119,11 @@ class _Visitor implements i18n.Visitor { } visitPlaceholder(ph: i18n.Placeholder, context?: any): xml.Node[] { - return [new xml.Tag(_PLACEHOLDER_TAG, {name: ph.name}, [], false)]; + return [new xml.Tag(_PLACEHOLDER_TAG, {name: ph.name})]; } visitIcuPlaceholder(ph: i18n.IcuPlaceholder, context?: any): xml.Node[] { - return [new xml.Tag(_PLACEHOLDER_TAG, {name: ph.name}, [], false)]; + return [new xml.Tag(_PLACEHOLDER_TAG, {name: ph.name})]; } serialize(nodes: i18n.Node[]): xml.Node[] { diff --git a/modules/@angular/compiler/src/i18n/serializers/xml_helper.ts b/modules/@angular/compiler/src/i18n/serializers/xml_helper.ts index cf01674b5e..e7cbc8bbcb 100644 --- a/modules/@angular/compiler/src/i18n/serializers/xml_helper.ts +++ b/modules/@angular/compiler/src/i18n/serializers/xml_helper.ts @@ -18,8 +18,7 @@ class _Visitor implements IVisitor { const strAttrs = this._serializeAttributes(tag.attrs); if (tag.children.length == 0) { - return tag.canSelfClose ? `<${tag.name}${strAttrs}/>` : - `<${tag.name}${strAttrs}>`; + return `<${tag.name}${strAttrs}/>`; } const strChildren = tag.children.map(node => node.visit(this)); @@ -72,8 +71,8 @@ export class Tag implements Node { public attrs: {[k: string]: string} = {}; constructor( - public name: string, unescapedAttrs: {[k: string]: string} = {}, public children: Node[] = [], - public canSelfClose: boolean = true) { + public name: string, unescapedAttrs: {[k: string]: string} = {}, + public children: Node[] = []) { Object.keys(unescapedAttrs).forEach((k: string) => { this.attrs[k] = _escapeXml(unescapedAttrs[k]); }); diff --git a/modules/@angular/compiler/test/i18n/integration_spec.ts b/modules/@angular/compiler/test/i18n/integration_spec.ts index f9b4d3a8ba..7823c42634 100644 --- a/modules/@angular/compiler/test/i18n/integration_spec.ts +++ b/modules/@angular/compiler/test/i18n/integration_spec.ts @@ -208,9 +208,9 @@ const XMB = ` {VAR_SELECT, select, m {male} f {female} } - - sex = > - + + sex = + in a translatable section <h1>Markers in html comments</h1> diff --git a/modules/@angular/compiler/test/i18n/serializers/xmb_spec.ts b/modules/@angular/compiler/test/i18n/serializers/xmb_spec.ts index e71c8c49d6..ecfe0b1519 100644 --- a/modules/@angular/compiler/test/i18n/serializers/xmb_spec.ts +++ b/modules/@angular/compiler/test/i18n/serializers/xmb_spec.ts @@ -46,7 +46,7 @@ export function main(): void { ]> - translatable element <b>with placeholders</b> + translatable element <b>with placeholders</b> {VAR_PLURAL, plural, =0 {<p>test</p>} } foo foo