<commit_before>App.MarkdownTextEditor = {
  instances: [],
  initialize: function($textAreas) {
    var that = this;

    $(document).one('turbolinks:before-cache.markdownTextEditor', function() {
      that.teardown();
    });

    $textAreas.each(function() {
      var $textArea = $(this);
      var placeholder = $textArea.attr('placeholder');

      var editor = new SimpleMDE({
        element: this,
        placeholder: placeholder,
        spellChecker: false,
        status: false,
        autoDownloadFontAwesome: false,
        toolbar: [
          'bold',
          'italic',
          'heading',
          '|',
          'unordered-list',
          'ordered-list',
          '|',
          'link',
          '|',
          {
            name: 'guide',
            action: 'https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet',
            className: 'fa fa-question-circle',
            title: 'Markdown Guide',
            default: true
          },
        ],
        shortcuts: {<commit_msg>Don't reinitialize markdown editors once they are initialized<commit_after>App.MarkdownTextEditor = {
  instances: [],
  initialize: function($textAreas) {
    var that = this;

    $(document).one('turbolinks:before-cache.markdownTextEditor', function() {
      that.teardown();
    });

    $textAreas.each(function() {
      var $textArea = $(this);
      var placeholder = $textArea.attr('placeholder');

      if ( ( $textArea.data('forest') && $textArea.data('forest').markdownInitialized ) || $textArea.closest('.CodeMirror').length ) {
        return;
      }

      $textArea.data('forest') || $textArea.data('forest', {});
      $textArea.data('forest', { markdownInitialized: true });

      var editor = new SimpleMDE({
        element: this,
        placeholder: placeholder,
        spellChecker: false,
        status: false,
        autoDownloadFontAwesome: false,
        toolbar: [
          'bold',
          'italic',
          'heading',
          '|',
          'unordered-list',
          'ordered-list',
          '|',
          'link',
          '|',
          {
            name: 'guide',
            action: 'https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet',
            className: 'fa fa-question-circle',
            title: 'Markdown Guide',
            default: true
          },
        ],
        shortcuts: {
{'fraction_non_alphanumeric': 0.1453781512605042, 'fraction_numerical': 0.0, 'mean_word_length': 1.9214723926380368, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4628922', 'n_tokens_mistral': 696, 'n_tokens_neox': 672, 'n_words': 119}