avoid unneeded whitespace in style XML output
This commit is contained in:
parent
16f60edc50
commit
3f70b8a36c
@ -28,19 +28,19 @@ tree.StyleXML = function(name, attachment, definitions, env) {
|
||||
if (image_filters.length) {
|
||||
attrs_xml += ' image-filters="' + image_filters.map(function(f) {
|
||||
return f.ev(env).toXML(env, true, ',', 'image-filter');
|
||||
}).join(',') + '" ';
|
||||
}).join(',') + '"';
|
||||
}
|
||||
|
||||
if (comp_op.length) {
|
||||
attrs_xml += ' comp-op="' + comp_op[0].value.ev(env).toString() + '" ';
|
||||
attrs_xml += ' comp-op="' + comp_op[0].value.ev(env).toString() + '"';
|
||||
}
|
||||
|
||||
if (opacity.length) {
|
||||
attrs_xml += ' opacity="' + opacity[0].value.ev(env).toString() + '" ';
|
||||
attrs_xml += ' opacity="' + opacity[0].value.ev(env).toString() + '"';
|
||||
}
|
||||
var rule_string = rules.join('');
|
||||
if (!attrs_xml && !rule_string) return '';
|
||||
return '<Style name="' + name + '" filter-mode="first" ' + attrs_xml + '>\n' + rule_string + '</Style>';
|
||||
return '<Style name="' + name + '" filter-mode="first"' + attrs_xml + '>\n' + rule_string + '</Style>';
|
||||
};
|
||||
|
||||
})(require('../tree'));
|
||||
|
@ -1,4 +1,4 @@
|
||||
<Style name="style-power" filter-mode="first" >
|
||||
<Style name="style-power" filter-mode="first">
|
||||
<Rule>
|
||||
<Filter>([power] = 'generator') and ([generator:source] = 'wind')</Filter>
|
||||
<MarkersSymbolizer width="0" />
|
||||
|
@ -1,2 +1,2 @@
|
||||
<Style name="style" filter-mode="first" opacity="0.5" >
|
||||
<Style name="style" filter-mode="first" opacity="0.5">
|
||||
</Style>
|
@ -1,2 +1,2 @@
|
||||
<Style name="style" filter-mode="first" comp-op="color-burn" >
|
||||
<Style name="style" filter-mode="first" comp-op="color-burn">
|
||||
</Style>
|
@ -1,2 +1,2 @@
|
||||
<Style name="style" filter-mode="first" image-filters="invert" >
|
||||
<Style name="style" filter-mode="first" image-filters="invert">
|
||||
</Style>
|
Loading…
Reference in New Issue
Block a user