Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
imageClass = _require.imageClass,
imageBackgroundClass = _require.imageBackgroundClass,
imageWrapperClass = _require.imageWrapperClass;
var visitWithParents = require("unist-util-visit-parents");
var getDefinitions = require("mdast-util-definitions");
var path = require("path");
var isRelativeUrl = require("is-relative-url");
var _ = require("lodash");
var _require2 = require("gatsby-plugin-sharp"),
fluid = _require2.fluid;
var Promise = require("bluebird");
var cheerio = require("cheerio");
var slash = require("slash");
var _require3 = require("gatsby-source-filesystem"),
createRemoteFileNode = _require3.createRemoteFileNode; // If the image is relative (not hosted elsewhere)
// 1. Find the image file
// 2. Find the image's size
// 3. Filter out any responsive image fluid sizes that are greater than the image's width
// 4. Create the responsive images.
// 5. Set the html w/ aspect ratio helper.
'use strict';
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
var select = require('unist-util-select');
var path = require('path');
var isRelativeUrl = require('is-relative-url');
var _ = require('lodash');
var _require = require('gatsby-plugin-sharp'),
sizes = _require.sizes;
var Promise = require('bluebird');
var cheerio = require('cheerio');
var slash = require('slash');
var regeneratorRuntime = require('regenerator-runtime/runtime');
// If the image is relative (not hosted elsewhere)
// 1. Find the image file
// 2. Find the image's size
// 3. Filter out any responsive image sizes that are greater than the image's width
// 4. Create the responsive images.
// 5. Set the html w/ aspect ratio helper.
module.exports = function (_ref, pluginOptions) {
var files = _ref.files,
markdownNode = _ref.markdownNode,
markdownAST = _ref.markdownAST,