Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9f45675496 | ||
|
fa994557e8 | ||
|
761b05b599 | ||
|
6745bdf634 | ||
|
8d4d1c8a50 | ||
|
c89ed510ff | ||
|
a6439e3f92 | ||
|
9e8eebcd5a | ||
|
8b0940b2c3 | ||
|
ebf08584d3 | ||
|
e9c1e3925d | ||
|
9043e70cf3 | ||
|
7b6a4b7820 | ||
|
66216f7c7d |
@ -673,7 +673,7 @@ carto.Parser = function Parser(env) {
|
|||||||
zoom: function() {
|
zoom: function() {
|
||||||
save();
|
save();
|
||||||
var op, val;
|
var op, val;
|
||||||
if ($(/^\[zoom/g) &&
|
if ($(/^\[\s*zoom/g) &&
|
||||||
(op = $(this.entities.comparison)) &&
|
(op = $(this.entities.comparison)) &&
|
||||||
(val = $(/^\d+/)) &&
|
(val = $(/^\d+/)) &&
|
||||||
$(']')) {
|
$(']')) {
|
||||||
|
@ -128,8 +128,8 @@ tree.Definition.prototype.symbolizersToXML = function(env, symbolizers, zoom) {
|
|||||||
}
|
}
|
||||||
if (selfclosing) {
|
if (selfclosing) {
|
||||||
xml += '/>\n';
|
xml += '/>\n';
|
||||||
} else {
|
} else if (tagcontent) {
|
||||||
if (tagcontent.indexOf('<Format') != -1) {
|
if (tagcontent.indexOf('<') != -1) {
|
||||||
xml += '>' + tagcontent + '</' + name + '>\n';
|
xml += '>' + tagcontent + '</' + name + '>\n';
|
||||||
} else {
|
} else {
|
||||||
xml += '><![CDATA[' + tagcontent + ']]></' + name + '>\n';
|
xml += '><![CDATA[' + tagcontent + ']]></' + name + '>\n';
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
(function(tree) {
|
(function(tree) {
|
||||||
|
|
||||||
tree.Filter = function Filter(key, op, val, index, filename) {
|
tree.Filter = function Filter(key, op, val, index, filename) {
|
||||||
|
|
||||||
|
// See https://github.com/mapbox/carto/issues/180
|
||||||
|
// TODO: use mapnik-reference for these conversion ?
|
||||||
|
if ( key == "mapnik-geometry-type" ) {
|
||||||
|
key = "mapnik::geometry_type"
|
||||||
|
}
|
||||||
|
|
||||||
if (key.is) {
|
if (key.is) {
|
||||||
this.key = key.value;
|
this.key = key.value;
|
||||||
this._key = key;
|
this._key = key;
|
||||||
|
@ -7,7 +7,12 @@ tree.Quoted = function Quoted(content) {
|
|||||||
|
|
||||||
tree.Quoted.prototype = {
|
tree.Quoted.prototype = {
|
||||||
toString: function(quotes) {
|
toString: function(quotes) {
|
||||||
var xmlvalue = this.value.replace(/\'/g, ''');
|
var xmlvalue = this.value
|
||||||
|
.replace(/&/g, '&')
|
||||||
|
.replace(/\'/g, '\\\'')
|
||||||
|
.replace(/\"/g, '"')
|
||||||
|
.replace(/</g, '<')
|
||||||
|
.replace(/\>/g, '>');
|
||||||
return (quotes === true) ? "'" + xmlvalue + "'" : this.value;
|
return (quotes === true) ? "'" + xmlvalue + "'" : this.value;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "carto",
|
"name": "carto",
|
||||||
"version": "0.9.3",
|
"version": "0.9.3-cdb6",
|
||||||
"description": "Mapnik Stylesheet Compiler",
|
"description": "Mapnik Stylesheet Compiler",
|
||||||
"url": "https://github.com/mapbox/carto",
|
"url": "https://github.com/mapbox/carto",
|
||||||
"repositories": [{
|
"repositories": [{
|
||||||
@ -36,7 +36,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"underscore": "~1.3.3",
|
"underscore": "~1.3.3",
|
||||||
"mapnik-reference": "~5.0.0",
|
"mapnik-reference": "git://github.com/CartoDB/mapnik-reference.git#cdb-5.0",
|
||||||
"xml2js": "~0.1.13"
|
"xml2js": "~0.1.13"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
11
package.json.README
Normal file
11
package.json.README
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Since we can't put comments in the package.json file
|
||||||
|
this file fills that gap.
|
||||||
|
|
||||||
|
Dependencies needing comments:
|
||||||
|
|
||||||
|
"mapnik-reference"
|
||||||
|
|
||||||
|
We use our own fork because we need advertisement of "marker-multi-policy"
|
||||||
|
which is only in the reference of mapnik-2.1.1. Can be reverted to upstream
|
||||||
|
once this pull request is released:
|
||||||
|
https://github.com/mapnik/mapnik-reference/pull/41
|
4
test/errorhandling/issue297.mss
Normal file
4
test/errorhandling/issue297.mss
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#t {
|
||||||
|
text-name: invalid;
|
||||||
|
text-face-name: "Dejagnu";
|
||||||
|
}
|
1
test/errorhandling/issue297.result
Normal file
1
test/errorhandling/issue297.result
Normal file
@ -0,0 +1 @@
|
|||||||
|
issue297.mss:2:2 Invalid value for text-name, the type expression is expected. invalid (of type keyword) was given.
|
23
test/quoted.test.js
Normal file
23
test/quoted.test.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
var assert = require('assert');
|
||||||
|
var tree = require('../lib/carto/tree.js');
|
||||||
|
require('../lib/carto/tree/quoted');
|
||||||
|
|
||||||
|
describe('Quoted', function() {
|
||||||
|
describe('basic functionality', function() {
|
||||||
|
it('should be constructed', function() {
|
||||||
|
var f = new tree.Quoted("Tom's & \"<quoted>\"");
|
||||||
|
assert.ok(f);
|
||||||
|
assert.equal(f.is, 'string');
|
||||||
|
});
|
||||||
|
it('should produce normal output', function() {
|
||||||
|
var f = new tree.Quoted("Tom's & \"<quoted>\"");
|
||||||
|
assert.ok(f);
|
||||||
|
assert.equal(f.toString(), "Tom's & \"<quoted>\"");
|
||||||
|
});
|
||||||
|
it('should produce xml-friendly output', function() {
|
||||||
|
var f = new tree.Quoted("Tom's & \"<quoted>\"");
|
||||||
|
assert.ok(f);
|
||||||
|
assert.equal(f.toString(true), "'Tom\\'s & "<quoted>"'");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<Style name="world" filter-mode="first">
|
<Style name="world" filter-mode="first">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>([name2] = ' Sa'ad')</Filter>
|
<Filter>([name2] = ' Sa\'ad')</Filter>
|
||||||
<PolygonSymbolizer fill="#ffffff" />
|
<PolygonSymbolizer fill="#ffffff" />
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
Loading…
Reference in New Issue
Block a user