inline-css
Advanced tools
Comparing version 2.2.2 to 2.2.3
'use strict'; | ||
var cssSelector = require('style-selector'), | ||
var cssSelector = require('./styleSelector'), | ||
importantSelector = cssSelector('<!important>', [ 2, 0, 0, 0 ]), | ||
property = require('css-property'); | ||
property = require('./cssProperty'); | ||
@@ -7,0 +7,0 @@ function getProperty(style, name, selector) { |
'use strict'; | ||
var cssSelector = require('style-selector'), | ||
var cssSelector = require('./styleSelector'), | ||
parseCSS = require('css-rules'), | ||
@@ -5,0 +5,0 @@ styleSelector = cssSelector('<style attribute>', [ 1, 0, 0, 0 ]), |
'use strict'; | ||
var cssSelector = require('style-selector'); | ||
var parser = require('slick').parse; | ||
function parseSelector(rule) { | ||
var sel = rule[0], | ||
selector = cssSelector(sel); | ||
/** | ||
* Parses a selector and returns the tokens. | ||
* | ||
* @param {String} selector | ||
* @api private. | ||
*/ | ||
return selector.parsed(); | ||
function parse(text) { | ||
try { | ||
return parser(text)[0]; | ||
} catch (e) { | ||
return []; | ||
} | ||
} | ||
@@ -19,3 +27,3 @@ | ||
// skip rule if the selector has any pseudos which are ignored | ||
parsedSelector = parseSelector(rule); | ||
parsedSelector = parse(rule[0]); | ||
@@ -22,0 +30,0 @@ for (i = 0; i < parsedSelector.length; ++i) { |
{ | ||
"name": "inline-css", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "Inline css into an html file.", | ||
@@ -10,5 +10,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"bluebird": "^2.9.25", | ||
"cheerio": "^0.19.0", | ||
"css-property": "^2.0.0", | ||
"bluebird": "^3.5.1", | ||
"cheerio": "0.19.0", | ||
"css-rules": "^1.0.0", | ||
@@ -19,13 +18,14 @@ "extend": "^3.0.0", | ||
"object.pick": "^1.1.1", | ||
"style-selector": "^2.0.0" | ||
"slick": "^1.12.1", | ||
"specificity": "^0.3.2" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^2.11.6", | ||
"coveralls": "^3.0.0", | ||
"gulp": "^3.9.0", | ||
"gulp-eslint": "^1.1.1", | ||
"gulp-mocha": "^2.0.0", | ||
"gulp-eslint": "^4.0.0", | ||
"gulp-mocha": "^4.3.1", | ||
"gulp-util": "^3.0.2", | ||
"mocha": "^2.1.0", | ||
"nyc": "^5.0.0", | ||
"should": "^5.2.0" | ||
"mocha": "^4.0.1", | ||
"nyc": "^11.3.0", | ||
"should": "*" | ||
}, | ||
@@ -32,0 +32,0 @@ "engines": { |
@@ -129,4 +129,22 @@ # inline-css [![npm](http://img.shields.io/npm/v/inline-css.svg?style=flat)](https://badge.fury.io/js/inline-css) [![Build Status](https://travis-ci.org/jonkemp/inline-css.svg?branch=master)](https://travis-ci.org/jonkemp/inline-css) [![Coverage Status](https://coveralls.io/repos/jonkemp/inline-css/badge.svg?branch=master&service=github)](https://coveralls.io/github/jonkemp/inline-css?branch=master) | ||
How to resolve hrefs. **Required**. | ||
How to resolve hrefs. Must be a string of one character or more. **Required**. | ||
Relative urls in links will have this value prepended to them. So these links: | ||
* `<a href="page-relative">Page</a>` | ||
* `<a href="/root-relative">Root</a>` <- _note leading /_ | ||
With this option: | ||
```js | ||
inlineCss(html, { url: 'http://example.com/mushroom'}) | ||
.then(function(html) { console.log(html); }); | ||
``` | ||
Will result in | ||
* `<a href="http://example.com/mushroom/page-relative">Page</a>` | ||
* `<a href="http://example.com/root-relative">Root</a>` | ||
If you don't need this feature, simply set the property to a short string eg `{url: ' '}` (one space) and everything will work. | ||
#### options.preserveMediaQueries | ||
@@ -133,0 +151,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18609
15
412
188
+ Addedslick@^1.12.1
+ Addedspecificity@^0.3.2
+ Addedbluebird@3.7.2(transitive)
+ Addedspecificity@0.3.2(transitive)
- Removedcss-property@^2.0.0
- Removedstyle-selector@^2.0.0
- Removedbluebird@2.11.0(transitive)
- Removedcss-property@2.0.3(transitive)
- Removedstyle-selector@2.0.5(transitive)
Updatedbluebird@^3.5.1
Updatedcheerio@0.19.0