First step towards actual style-naming

This commit is contained in:
Tom MacWright 2011-01-03 15:28:28 -05:00
parent 6cb8a9a94a
commit 04a4900cc6
2 changed files with 6 additions and 1 deletions

View File

@ -6,7 +6,11 @@ tree.Element = function (combinator, value) {
this.value = value.toCSS ? value.toCSS() : value.trim();
};
tree.Element.prototype.toCSS = function (env) {
return this.combinator.toCSS(env || {}) + this.value;
// make names XML-safe in a dreadfully simple manner
return this.combinator.toCSS(env || {}) + this.value
.replace('#', 'id-')
.replace('.', 'class-');
};
tree.Combinator = function (value) {
if (value === ' ') {

View File

@ -183,6 +183,7 @@ tree.Ruleset.prototype = {
return out;
})(symbolizers);
}
console.log(selector);
css.push('<Style>\n' +
selector +
'\n<Rule>\n' +