Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return function imgTag(args, content) {
const classes = [];
let src, width, height, title, alt;
// Find image URL and class name
while (args.length > 0) {
const item = args.shift();
if (rUrl.test(item) || item[0] === '/') {
src = url_for.call(ctx, item);
break;
} else {
classes.push(item);
}
}
// Find image width and height
if (args && args.length) {
if (!/\D+/.test(args[0])) {
width = args.shift();
if (args.length && !/\D+/.test(args[0])) {
height = args.shift();
}
}
function autodiscoveryInject(data) {
const { config } = this;
const { feed } = config;
const { path, type } = feed;
let autodiscoveryTag = '';
if (data.match(/type=['|"]?application\/(atom|rss)\+xml['|"]?/i) || feed.autodiscovery === false) return;
if (typeof type === 'string') {
autodiscoveryTag += `\n`;
} else {
type.forEach((feedType, i) => {
autodiscoveryTag += `\n`;
});
}
return data.replace(/(?!<\/head>).+?<\/head>/s, str => str.replace('', `${autodiscoveryTag}`));
}
type.forEach((feedType, i) => {
autodiscoveryTag += `\n`;
});
}
image(href, title, text) {
const { options } = this;
if (!parse(href).hostname && !options.config.relative_link
&& options.prependRoot) {
href = url_for.call(options, href);
}
let out = `