<commit_before>define(
    'abilian-init-scribe-widget',
    ['jquery',
     'scribe',
     'scribe-plugin-blockquote-command',
     'scribe-plugin-curly-quotes',
     'scribe-plugin-formatter-plain-text-convert-new-lines-to-html',
     'scribe-plugin-heading-command',
     'scribe-plugin-intelligent-unlink-command',
     'scribe-plugin-keyboard-shortcuts',
     'scribe-plugin-link-prompt-command',
     'scribe-plugin-sanitizer',
     'scribe-plugin-smart-lists',
     'scribe-plugin-abilian-toolbar'
    ],
    function (
        $,
        Scribe,
        scribePluginBlockquoteCommand,
        scribePluginCurlyQuotes,
        scribePluginFormatterPlainTextConvertNewLinesToHtml,
        scribePluginHeadingCommand,
        scribePluginIntelligentUnlinkCommand,
        scribePluginKeyboardShortcuts,
        scribePluginLinkPromptCommand,
        scribePluginSanitizer,
        scribePluginSmartLists,
        scribePluginAbilianToolbar) {

        'use strict';

        var defaultAllowedTags = {
            'a': ['href', 'title'],
            'abbr': ['title'],
            'acronym': ['title'],
            'b': true,
            'blockquote': true,
            'br': true,
            'code': true,
            'em': true,
            'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
            'i': true,
            'img': ['src'],
            'li': true,
            'ol': true,
            'strong': true,
            'ul': true,
            'p': ['align'],
            'u': true
        };


        function initWidget(element) {
            var $element = $(element);
            var inputName = element.dataset.name;
            var input = element.querySelector('input[type="hidden"]' +
                                              '[name="' + inputName + '"]');
            var editorEl = element.querySelector('.editor');
            var scribe = new Scribe(editorEl, { allowBlockElements: true });
            var rows = parseInt(element.dataset.rows || 10),
                lineHeight = parseFloat(window.getComputedStyle(element).lineHeight);
            editorEl.style.height = (rows * lineHeight) + "px";
            editorEl.style.overflowX = 'hidden';
            editorEl.style.overflowY = 'auto';

            function updateInput() {
                input.value = scribe.getHTML();
            }
            scribe.on('content-changed', updateInput);
<commit_msg>richtextwidget: fix sanitizer initialization<commit_after>define(
    'abilian-init-scribe-widget',
    ['jquery',
     'scribe',
     'scribe-plugin-blockquote-command',
     'scribe-plugin-curly-quotes',
     'scribe-plugin-formatter-plain-text-convert-new-lines-to-html',
     'scribe-plugin-heading-command',
     'scribe-plugin-intelligent-unlink-command',
     'scribe-plugin-keyboard-shortcuts',
     'scribe-plugin-link-prompt-command',
     'scribe-plugin-sanitizer',
     'scribe-plugin-smart-lists',
     'scribe-plugin-abilian-toolbar'
    ],
    function (
        $,
        Scribe,
        scribePluginBlockquoteCommand,
        scribePluginCurlyQuotes,
        scribePluginFormatterPlainTextConvertNewLinesToHtml,
        scribePluginHeadingCommand,
        scribePluginIntelligentUnlinkCommand,
        scribePluginKeyboardShortcuts,
        scribePluginLinkPromptCommand,
        scribePluginSanitizer,
        scribePluginSmartLists,
        scribePluginAbilianToolbar) {

        'use strict';

        var defaultAllowedTags = {
            'a': {'href': true, 'title': true},
            'abbr': {'title': true},
            'acronym': {'title': true},
            'b': true,
            'blockquote': true,
            'br': true,
            'code': true,
            'em': true,
            'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
            'i': true,
            'img': {'src': true},
            'li': true,
            'ol': true,
            'strong': true,
            'ul': true,
            'p': {'align': true},
            'u': true
        };


        function initWidget(element) {
            var $element = $(element);
            var inputName = element.dataset.name;
            var input = element.querySelector('input[type="hidden"]' +
                                              '[name="' + inputName + '"]');
            var editorEl = element.querySelector('.editor');
            var scribe = new Scribe(editorEl, { allowBlockElements: true });
            var rows = parseInt(element.dataset.rows || 10),
                lineHeight = parseFloat(window.getComputedStyle(element).lineHeight);
            editorEl.style.height = (rows * lineHeight) + "px";
            editorEl.style.overflowX = 'hidden';
            editorEl.style.overflowY = 'auto';

            function updateInput() {
                input.value = scribe.getHTML();
            }
            scribe.on('content-changed', updateInput);

{'fraction_non_alphanumeric': 0.1341339303887645, 'fraction_numerical': 0.003256665988194586, 'mean_word_length': 1.9215219976218787, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4808198', 'n_tokens_mistral': 1391, 'n_tokens_neox': 1343, 'n_words': 243}