css-parse
Advanced tools
Comparing version 1.5.2 to 1.5.3
{ | ||
"name": "css-parse", | ||
"repo": "visionmedia/css-parse", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "CSS parser", | ||
@@ -6,0 +6,0 @@ "keywords": ["css", "parser", "stylesheet"], |
1.5.3 / 2013-09-10 | ||
================== | ||
* add trim shim function. Closes #45 | ||
* fix: parser now correctly parses attributes with whitespace before colon | ||
1.5.2 / 2013-07-28 | ||
@@ -3,0 +9,0 @@ ================== |
29
index.js
@@ -101,3 +101,3 @@ | ||
comments(rules); | ||
while (css[0] != '}' && (node = atrule() || rule())) { | ||
while (css.charAt(0) != '}' && (node = atrule() || rule())) { | ||
rules.push(node); | ||
@@ -147,6 +147,6 @@ comments(rules); | ||
var pos = position(); | ||
if ('/' != css[0] || '*' != css[1]) return; | ||
if ('/' != css.charAt(0) || '*' != css.charAt(1)) return; | ||
var i = 2; | ||
while (null != css[i] && ('*' != css[i] || '/' != css[i + 1])) ++i; | ||
while (null != css.charAt(i) && ('*' != css.charAt(i) || '/' != css.charAt(i + 1))) ++i; | ||
i += 2; | ||
@@ -173,3 +173,3 @@ | ||
if (!m) return; | ||
return m[0].trim().split(/\s*,\s*/); | ||
return trim(m[0]).split(/\s*,\s*/); | ||
} | ||
@@ -187,3 +187,3 @@ | ||
if (!prop) return; | ||
prop = prop[0]; | ||
prop = trim(prop[0]); | ||
@@ -200,3 +200,3 @@ // : | ||
property: prop, | ||
value: val[0].trim() | ||
value: trim(val[0]) | ||
}); | ||
@@ -298,3 +298,3 @@ | ||
if (!m) return; | ||
var supports = m[1].trim(); | ||
var supports = trim(m[1]); | ||
@@ -323,3 +323,3 @@ if (!open()) return error("@supports missing '{'"); | ||
if (!m) return; | ||
var media = m[1].trim(); | ||
var media = trim(m[1]); | ||
@@ -378,4 +378,4 @@ if (!open()) return error("@media missing '{'"); | ||
var vendor = (m[1] || '').trim(); | ||
var doc = m[2].trim(); | ||
var vendor = trim(m[1]); | ||
var doc = trim(m[2]); | ||
@@ -429,3 +429,3 @@ if (!open()) return error("@document missing '{'"); | ||
var ret = { type: name }; | ||
ret[name] = m[1].trim(); | ||
ret[name] = trim(m[1]); | ||
return pos(ret); | ||
@@ -470,1 +470,8 @@ } | ||
/** | ||
* Trim `str`. | ||
*/ | ||
function trim(str) { | ||
return (str || '').replace(/^\s+|\s+$/g, ''); | ||
} |
{ | ||
"name": "css-parse", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "CSS parser", | ||
"keywords": ["css", "parser", "stylesheet"], | ||
"keywords": [ | ||
"css", | ||
"parser", | ||
"stylesheet" | ||
], | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -12,3 +16,7 @@ "license": "MIT", | ||
}, | ||
"main": "index" | ||
"main": "index", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/visionmedia/css-parse.git" | ||
} | ||
} |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
13101
370
1
1
0