mirror of
https://github.com/panosoft/inline-html
synced 2026-01-13 13:04:30 -08:00
Fix bug where template expressions were interpreted as paths.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
var cheerio = require('cheerio');
|
||||
var datauri = require('datauri');
|
||||
var isLocalPath = require('is-local-path');
|
||||
var isTemplateExpression = require('./is-template-expression');
|
||||
var path = require('path');
|
||||
|
||||
var inline = function (html, filename) {
|
||||
@@ -8,7 +9,8 @@ var inline = function (html, filename) {
|
||||
var basedir = path.dirname(filename);
|
||||
var $ = cheerio.load(html, {decodeEntities: false});
|
||||
var images = $('img').filter(function (index, element) {
|
||||
return isLocalPath($(element).attr('src'));
|
||||
var path = $(element).attr('src');
|
||||
return isLocalPath(path) && !isTemplateExpression(path);
|
||||
});
|
||||
images.each(function (index, element) {
|
||||
var src = $(element).attr('src');
|
||||
|
||||
Reference in New Issue
Block a user