mirror of
https://github.com/KevinMidboe/inline-html.git
synced 2025-10-29 17:40:29 +00:00
Fix bug where template expressions were interpreted as paths.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
var datauri = require('datauri');
|
||||
var isLocalPath = require('is-local-path');
|
||||
var isTemplateExpression = require('./is-template-expression');
|
||||
var path = require('path');
|
||||
var postcss = require('postcss');
|
||||
var postcssUrl = require('postcss-url');
|
||||
@@ -33,7 +34,7 @@ var inline = function (css, filename) {
|
||||
var result = postcss()
|
||||
.use(postcssUrl({
|
||||
url: function (urlPath) {
|
||||
if (isLocalPath(urlPath)) {
|
||||
if (isLocalPath(urlPath) && !isTemplateExpression(urlPath)) {
|
||||
urlPath = clean(urlPath);
|
||||
urlPath = path.resolve(basePath, urlPath);
|
||||
files.push(urlPath);
|
||||
|
||||
Reference in New Issue
Block a user