<commit_before>var app = angular.module("reveangular", []);

function parseStep (sce, step, elem) {
    step = step || "";
    if (!elem) {
        elem = angular.element("<section>");
    }
    if ("string" === typeof step) {
        elem.html(step);
    } 
    else if (step) {
        for (var i = 0; i < step.length; i++) {
            var item = step[i];
            if (item && "object" === typeof item) {
                var source = item.name;
                if (item.attributes) {
                    for (var attr in item.attributes) {
                        if (attr && item.attributes.hasOwnProperty(attr)) {
                            source += " " + attr + "=\"" + item.attributes[attr] + "\"";
                        }
                    }
                }
                var html = sce.trustAsHtml("<" + source + ">").toString();
                var subElem = angular.element(html);
                parseStep(sce, item.value, subElem);
                elem.append(subElem);
            } 
            else if (item && "string" === typeof item) {
                elem.html(item);
            }
        }
    }
<commit_msg>Add notes support<commit_after>var app = angular.module("reveangular", []);

function parseStep (sce, step, elem) {
    step = step || "";
    if (!elem) {
        elem = angular.element("<section>");
    }
    if ("string" === typeof step) {
        elem.html(step);
    } 
    else if (step) {
        for (var i = 0; i < step.length; i++) {
            var item = step[i];
            if (item && "object" === typeof item) {
                var source = item.name;
                if (item.attributes) {
                    for (var attr in item.attributes) {
                        if (attr && item.attributes.hasOwnProperty(attr)) {
                            source += " " + attr + "=\"" + item.attributes[attr] + "\"";
                        }
                    }
                }
                var html = sce.trustAsHtml("<" + source + ">").toString();
                var subElem = angular.element(html);
                parseStep(sce, item.value, subElem);
                elem.append(subElem);
                
                if (item.notes) {
                    var notes = angular.element(sce.trustAsHtml("<aside class=\"notes\">").toString());
                    notes.html(item.notes);
                    elem.append(notes);
                }
            } 
            else if (item && "string" === typeof item) {
                elem.html(item);
            }
        }
    }

{'fraction_non_alphanumeric': 0.14750882699097687, 'fraction_numerical': 0.0007846214201647705, 'mean_word_length': 1.2329246935201401, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2710045', 'n_tokens_mistral': 710, 'n_tokens_neox': 669, 'n_words': 154}