Revert "fix(compiler): xmb <ph>
tags should not self close (#13413)"
This reverts commit 4b3d135193
.
closes #13463
This commit is contained in:
@ -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[] {
|
||||
|
@ -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}></${tag.name}>`;
|
||||
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]);
|
||||
});
|
||||
|
Reference in New Issue
Block a user