<commit_before>/*
 * jQuery svg-typekit Plugin 0.1
 * https://github.com/willemvb/svg-typekit
 *
 * Copyright 2015, <NAME>
 * https://spatie.be
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

(function ($) {
    $.fn.svgTypekit = function () {

        var typeKitHref = getTypeKitStyleSheetUrl();
        var images = this;

        if (images.size() && typeKitHref) {

            //replace img[src=*.svg] with inline object[data=*.svg] for font support
            images.each(function () {

                //img to replace
                var img = $(this);
                var imgSrc = $(this).attr('src');

                //assure there is a .svg src
                if (imgSrc.search('.svg') > 0) {

                    //make object tag with image src
                    var svg = $('<object class="svg" type="image/svg+xml">').attr('data', imgSrc);
                    var svgDomElement = svg[0];

                    //replace img tag with object
                    img.replaceWith(svg);

                    //there is no load event for object so we loop until svg is available
                    var svgObjectLoaded = setInterval(function () {
                        //root element has to be svg
                        if (checkForSvgTag(svgDomElement)) {
                            clearTimeout(svgObjectLoaded);
                            styleSvgObjectWithTypeKit(svgDomElement, typeKitHref);
                        }
                    }, 50);
                }
            });
        }
<commit_msg>keep pre-existing classes on SVGs<commit_after>/*
 * jQuery svg-typekit Plugin 0.1
 * https://github.com/willemvb/svg-typekit
 *
 * Copyright 2015, <NAME>
 * https://spatie.be
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

(function ($) {
    $.fn.svgTypekit = function () {

        var typeKitHref = getTypeKitStyleSheetUrl();
        var images = this;

        if (images.size() && typeKitHref) {

            //replace img[src=*.svg] with inline object[data=*.svg] for font support
            images.each(function () {

                //img to replace
                var img = $(this),
                    imgSrc = $this.attr('src'),
                    imgClasses = $this.attr('class');

                //assure there is a .svg src
                if (imgSrc.search('.svg') > 0) {

                    //make object tag with image src
                    var svg = $('<object class="svg' + imgClasses + '" type="image/svg+xml">').attr('data', imgSrc);
                    var svgDomElement = svg[0];

                    //replace img tag with object
                    img.replaceWith(svg);

                    //there is no load event for object so we loop until svg is available
                    var svgObjectLoaded = setInterval(function () {
                        //root element has to be svg
                        if (checkForSvgTag(svgDomElement)) {
                            clearTimeout(svgObjectLoaded);
                            styleSvgObjectWithTypeKit(svgDomElement, typeKitHref);
                        }
                    }, 50);
                }
            });
        }

{'fraction_non_alphanumeric': 0.11404599129894344, 'fraction_numerical': 0.006215040397762586, 'mean_word_length': 1.372144436256448, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6386674', 'n_tokens_mistral': 886, 'n_tokens_neox': 815, 'n_words': 216}