<commit_before>function strip_tags(str, allowed_tags) {
    // http://kevin.vanzonneveld.net
    // +   original by: <NAME> (http://kevin.vanzonneveld.net)
    // *     example 1: strip_tags('<p>Kevin</p> <br /><b>van</b> <i>Zonneveld</i>', '<i>,<b>');
    // *     returns 1: 'Kevin <b>van</b> <i>Zonneveld</i>'
    
    var match = '';
    
    if (allowed_tags) {
        allowed_tags = allowed_tags.replace(/[><]/g, '');
        allowed_tags = allowed_tags.replace(/ /g, '');
        allowed_tags = allowed_tags.replace(/,/g, '|'); 
    }
    
    match = '/</?!('+allowed_tags+')[^>]*>/gi';
    alert(match);
    
    return str.replace(match, '');
}<commit_msg>Allowed Tags support for strip_tags<commit_after>function strip_tags(str, allowed_tags) {
    // http://kevin.vanzonneveld.net
    // +   original by: <NAME> (http://kevin.vanzonneveld.net)
    // *     example 1: strip_tags('<p>Kevin</p> <br /><b>van</b> <i>Zonneveld</i>', '<i>,<b>');
    // *     returns 1: 'Kevin <b>van</b> <i>Zonneveld</i>'
    
    var match = '';
    
    if (allowed_tags) {
        allowed_tags = allowed_tags.replace(/[><]/g, '');
        allowed_tags = allowed_tags.replace(/ /g, '');
        allowed_tags = allowed_tags.replace(/,/g, '|'); 
    }
    
    match = '/</?[^('+allowed_tags+')][^>]*>/gi';
    alert(match);
    
    return str.replace(match, '');
}
{'fraction_non_alphanumeric': 0.22974963181148747, 'fraction_numerical': 0.0029455081001472753, 'mean_word_length': 2.6047745358090184, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 37, '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': '4799930', 'n_tokens_mistral': 526, 'n_tokens_neox': 512, 'n_words': 76}