I'm trying to remove a jQuery dependency and replacing this .each with a loop is proving tricky.
// inline <img> when src = .svg so it is styled with CSS
$('[src$=".svg"]').each(function() { // get .svg
var $img = $(this);
var imgURL = $img.attr("src"); // get src url
$.get(
imgURL,
function(data) { // Get the SVG guts from image file
var $svg = $(data).find("svg");
$img.replaceWith($svg); // Replace img with SVG guts
}, "xml"
);
});