<commit_before>/* global angular, $ */
angular.module('suite')
    .directive('orphan', ['$timeout', function($timeout) {
        return {
            restrict: 'A',
            link: function($scope, element, attrs) {
                $timeout(function() {
                    $(element).widowFix();
                });
            }
        };
    }])
;
<commit_msg>Allow orpahn to work for multiple paragraphs.<commit_after>/* global angular, $ */
angular.module('suite')
    .directive('orphan', ['$timeout', function($timeout) {
        return {
            restrict: 'A',
            link: function($scope, element, attrs) {
                var $$element;
                var $$p;
                $timeout(function() {
                    $$element = $(element);
                    $$p = $$element.find('p');                    
                    if ($$p.length > 1) {
                        // If there are multiple paragraphs contained within
                        // element, then apply widowFix to each paragraph.
                        $.each($$p, function(i, p) {
                            $(p).widowFix();
                        });
                    } else {
                        // Otherwise, apply widowFix to the entire element.
                        $$element.widowFix();
                    }                
                });
            }
        };
    }])
;

{'fraction_non_alphanumeric': 0.1343817012151537, 'fraction_numerical': 0.0007147962830593281, 'mean_word_length': 1.06794682422452, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6171543', 'n_tokens_mistral': 343, 'n_tokens_neox': 322, 'n_words': 75}