mirror of
https://github.com/KevinMidboe/inline-html.git
synced 2025-12-08 20:29:06 +00:00
Updated is-local-path.
This commit is contained in:
@@ -7,14 +7,14 @@ var fs = require('mz/fs');
|
||||
|
||||
// TODO refactor into separate module
|
||||
// inline html images
|
||||
var localPath = require('local-path');
|
||||
var isLocalPath = require('is-local-path');
|
||||
var datauri = require('datauri');
|
||||
var path = require('path');
|
||||
var inlineImg = function (html, filePath) {
|
||||
var basedir = path.dirname(filePath);
|
||||
var $ = cheerio.load(html);
|
||||
var images = $('img').filter(function (index, element) {
|
||||
return localPath($(element).attr('src'));
|
||||
return isLocalPath($(element).attr('src'));
|
||||
});
|
||||
images.each(function (index, element) {
|
||||
var src = $(element).attr('src');
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"datauri": "^0.7.1",
|
||||
"inline-css-url": "file:../inline-css-url",
|
||||
"inline-less": "file:../inline-less",
|
||||
"local-path": "file:../local-path",
|
||||
"is-local-path": "0.0.1",
|
||||
"mz": "^2.0.0",
|
||||
"string": "^3.3.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user