nav tabs on admin dashboard
This commit is contained in:
25
node_modules/html-loader/index.js
generated
vendored
25
node_modules/html-loader/index.js
generated
vendored
@@ -39,7 +39,14 @@ module.exports = function(content) {
|
||||
}
|
||||
var root = config.root;
|
||||
var links = attrParse(content, function(tag, attr) {
|
||||
return attributes.indexOf(tag + ":" + attr) >= 0;
|
||||
var res = attributes.find(function(a) {
|
||||
if (a.charAt(0) === ':') {
|
||||
return attr === a.slice(1);
|
||||
} else {
|
||||
return (tag + ":" + attr) === a;
|
||||
}
|
||||
});
|
||||
return !!res;
|
||||
});
|
||||
links.reverse();
|
||||
var data = {};
|
||||
@@ -47,6 +54,8 @@ module.exports = function(content) {
|
||||
links.forEach(function(link) {
|
||||
if(!loaderUtils.isUrlRequest(link.value, root)) return;
|
||||
|
||||
if (link.value.indexOf('mailto:') > -1 ) return;
|
||||
|
||||
var uri = url.parse(link.value);
|
||||
if (uri.hash !== null && uri.hash !== undefined) {
|
||||
uri.hash = null;
|
||||
@@ -120,6 +129,9 @@ module.exports = function(content) {
|
||||
}
|
||||
|
||||
if(config.interpolate && config.interpolate !== 'require') {
|
||||
// Double escape quotes so that they are not unescaped completely in the template string
|
||||
content = content.replace(/\\"/g, "\\\\\"");
|
||||
content = content.replace(/\\'/g, "\\\\\'");
|
||||
content = compile('`' + content + '`').code;
|
||||
} else {
|
||||
content = JSON.stringify(content);
|
||||
@@ -135,7 +147,16 @@ module.exports = function(content) {
|
||||
|
||||
return exportsString + content.replace(/xxxHTMLLINKxxx[0-9\.]+xxx/g, function(match) {
|
||||
if(!data[match]) return match;
|
||||
return '" + require(' + JSON.stringify(loaderUtils.urlToRequest(data[match], root)) + ') + "';
|
||||
|
||||
var urlToRequest;
|
||||
|
||||
if (config.interpolate === 'require') {
|
||||
urlToRequest = data[match];
|
||||
} else {
|
||||
urlToRequest = loaderUtils.urlToRequest(data[match], root);
|
||||
}
|
||||
|
||||
return '" + require(' + JSON.stringify(urlToRequest) + ') + "';
|
||||
}) + ";";
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user