<commit_before>(function(exports) {

    exports.make_rich_text_editable = function(elements) {
        // create div to hook in hallo.js before each rich text editable form
        // field.
        elements.each(function() {
            var form_field = $(this);
            var rich_text = $('<div class="richtext"></div>').html('');
            rich_text.insertBefore(form_field);
            form_field.addClass('hidden');

            rich_text.hallo({
                plugins: {
                    'halloformat': {},
                    'halloheadings': {
                        formatBlocks: ['p', 'h2', 'h3', 'h4', 'h5']
                    },
                    'hallolists': {}
                }
            });
        });
        
    }

    exports.enable_rich_text = function(elements_selector, form_selector) {
        exports.make_rich_text_editable($(elements_selector))
<commit_msg>Fixed bug where rich text fields wouldn't repopulate after reload.<commit_after>(function(exports) {

    exports.make_rich_text_editable = function(elements) {
        // create div to hook in hallo.js before each rich text editable form
        // field.
        elements.each(function() {
            var form_field = $(this);
            var rich_text = $('<div class="richtext"></div>').html(form_field.html());
            rich_text.insertBefore(form_field);
            form_field.addClass('hidden');

            rich_text.hallo({
                plugins: {
                    'halloformat': {},
                    'halloheadings': {
                        formatBlocks: ['p', 'h2', 'h3', 'h4', 'h5']
                    },
                    'hallolists': {}
                }
            });
        });
        
    }

    exports.enable_rich_text = function(elements_selector, form_selector) {
        exports.make_rich_text_editable($(elements_selector))

{'fraction_non_alphanumeric': 0.1263326226012793, 'fraction_numerical': 0.0042643923240938165, 'mean_word_length': 1.658640226628895, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5310894', 'n_tokens_mistral': 516, 'n_tokens_neox': 493, 'n_words': 91}