<commit_before>
fusioApp.factory('helpLoader', ['$http', '$showdown', '$q', '$modal', function($http, $showdown, $q, $modal){
    var helper = {};
 
    helper.load = function(path){
        return $q(function(resolve, reject){
            $http.get(path).
                success(function(data, status){
                    // if the path has an fragment extract the part of the content
                    // with the heading
                    var parser = document.createElement('a');
                    parser.href = path;

                    if (parser.hash) {
                        var heading = parser.hash.substr(1);
                        var regexp = new RegExp('(^###\\s' + heading + '$\\s+([\\s\\S]*?))^###\\s', 'gmi');

                        matches = regexp.exec(data);
                        data = matches && matches.length > 0 ? matches[1] : 'Could not found chapter';
                    }

                    var html = $showdown.makeHtml(data);
<commit_msg>check whether hash is not empty<commit_after>
fusioApp.factory('helpLoader', ['$http', '$showdown', '$q', '$modal', function($http, $showdown, $q, $modal){
    var helper = {};
 
    helper.load = function(path){
        return $q(function(resolve, reject){
            $http.get(path).
                success(function(data, status){
                    // if the path has an fragment extract the part of the content
                    // with the heading
                    var parser = document.createElement('a');
                    parser.href = path;

                    if (parser.hash) {
                        var heading = parser.hash.substr(1);
                        if (heading != '') {
                            var regexp = new RegExp('(^###\\s' + heading + '$\\s+([\\s\\S]*?))^###\\s', 'gmi');
                            matches = regexp.exec(data);

                            data = matches && matches.length > 0 ? matches[1] : 'Could not found chapter';
                        }
                    }

                    var html = $showdown.makeHtml(data);

{'fraction_non_alphanumeric': 0.14732787674530573, 'fraction_numerical': 0.002888781896966779, 'mean_word_length': 1.3995381062355658, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2814618', 'n_tokens_mistral': 551, 'n_tokens_neox': 515, 'n_words': 139}