mirror of
https://github.com/KevinMidboe/inline-html.git
synced 2025-10-29 17:40:29 +00:00
Ignore template expression in link href.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const co = require('co');
|
||||
const fs = require('mz/fs');
|
||||
const isLocalPath = require('is-local-path');
|
||||
const isTemplateExpression = require('./is-template-expression');
|
||||
const less = require('less');
|
||||
const path = require('path');
|
||||
const R = require('ramda');
|
||||
@@ -38,7 +39,10 @@ const inlineLess = co.wrap(function * ($, filename, options) {
|
||||
var files = [];
|
||||
try {
|
||||
const links = $('link[rel="stylesheet/less"]')
|
||||
.filter((index, link) => isLocalPath($(link).attr('href')))
|
||||
.filter((index, link) => {
|
||||
const href = $(link).attr('href');
|
||||
return isLocalPath(href) && !isTemplateExpression(href);
|
||||
})
|
||||
.toArray();
|
||||
const getHref = element => path.resolve(basedir, $(element).attr('href'));
|
||||
const hrefs = R.map(getHref, links);
|
||||
|
||||
Reference in New Issue
Block a user