|
|
@ -10,15 +10,5 @@ export default class Text extends Node {
|
|
|
|
constructor(component: Component, parent: INode, scope: TemplateScope, info: any) {
|
|
|
|
constructor(component: Component, parent: INode, scope: TemplateScope, info: any) {
|
|
|
|
super(component, parent, scope, info);
|
|
|
|
super(component, parent, scope, info);
|
|
|
|
this.data = info.data;
|
|
|
|
this.data = info.data;
|
|
|
|
|
|
|
|
|
|
|
|
if (!component.component_options.preserveWhitespace && !/[\S\u00A0]/.test(info.data)) {
|
|
|
|
|
|
|
|
let node = parent;
|
|
|
|
|
|
|
|
while (node) {
|
|
|
|
|
|
|
|
if (node.type === 'Element' && node.name === 'pre') {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
node = node.parent;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|