Fix parsing of selectors with comments between elements.
This brings over cloudhead/less.js@3331637913 and fixes #179
This commit is contained in:
parent
912988e174
commit
101026fe3c
@ -690,7 +690,9 @@ carto.Parser = function Parser(env) {
|
||||
|
||||
while (s = $(this.selector)) {
|
||||
selectors.push(s);
|
||||
$(this.comment);
|
||||
if (! $(',')) { break; }
|
||||
$(this.comment);
|
||||
}
|
||||
if (s) $(this.comment);
|
||||
|
||||
|
14
test/rendering/weird_comments_2.mml
Normal file
14
test/rendering/weird_comments_2.mml
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
|
||||
"Stylesheet": [
|
||||
"weird_comments_2.mss"
|
||||
],
|
||||
"Layer": [{
|
||||
"name": "world",
|
||||
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
|
||||
"Datasource": {
|
||||
"file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip",
|
||||
"type": "shape"
|
||||
}
|
||||
}]
|
||||
}
|
7
test/rendering/weird_comments_2.mss
Normal file
7
test/rendering/weird_comments_2.mss
Normal file
@ -0,0 +1,7 @@
|
||||
#world {
|
||||
[ne_10m_adm = 'GBR'], /* United Kingdom */
|
||||
[ne_10m_adm = 'FRA'] /* France */
|
||||
{
|
||||
polygon-fill: #fff;
|
||||
}
|
||||
}
|
25
test/rendering/weird_comments_2.result
Normal file
25
test/rendering/weird_comments_2.result
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE Map[]>
|
||||
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" maximum-extent="-20037508.34,-20037508.34,20037508.34,20037508.34">
|
||||
|
||||
|
||||
<Style name="world" filter-mode="first" >
|
||||
<Rule>
|
||||
<Filter>([ne_10m_adm] = 'GBR')</Filter>
|
||||
<PolygonSymbolizer fill="#ffffff" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>([ne_10m_adm] = 'FRA')</Filter>
|
||||
<PolygonSymbolizer fill="#ffffff" />
|
||||
</Rule>
|
||||
</Style>
|
||||
<Layer name="world"
|
||||
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
|
||||
<StyleName>world</StyleName>
|
||||
<Datasource>
|
||||
<Parameter name="file"><![CDATA[[absolute path]]]></Parameter>
|
||||
<Parameter name="type"><![CDATA[shape]]></Parameter>
|
||||
</Datasource>
|
||||
</Layer>
|
||||
|
||||
</Map>
|
Loading…
Reference in New Issue
Block a user