<commit_before><div class="form-group showdown-form">
  <ul class="sorting-list showdown-form-controls">
    <li class="active"><a href="#" data-view="markdown">Markdown</a></li>
    <li><a href="#" data-view="preview">Preview</a></li>
  </ul>

  <%= model.text_area :text, class: 'form-control showdown-edit', id: 'markdown' %>

  <div class="showdown-content" id="preview" style="display: none;"></div>
</div>

<p class="help-block pull-right"><strong>*bold*</strong>&nbsp;&nbsp;&nbsp;<i>_italic_</i>&nbsp;&nbsp;&nbsp;<code>`code`</code>&nbsp;&nbsp;&nbsp;>quote&nbsp;&nbsp;&nbsp;&lt;link&gt;</p>



<script>
  var converter = new showdown.Converter();
  $(function () {
    $('.showdown-edit').on('keyup',function () {
      convert(this);
    });

    // allow tab press in textarea
    $('.showdown-edit').on('keydown',function (e) {
      var $this, end, start;
      if (e.keyCode === 9) {
        start = this.selectionStart;
        end = this.selectionEnd;
        $this = $(this);
        $this.val($this.val().substring(0, start) + "\t" + $this.val().substring(end));
        this.selectionStart = this.selectionEnd = start + 1;
        return false;
      }
    });

    convert('.showdown-edit');
  });

  function convert(id) {
    text = $(id).val();
    html = converter.makeHtml(text);<commit_msg>fix markdown helper ui<commit_after><div class="form-group showdown-form">
  <ul class="sorting-list showdown-form-controls">
    <li class="active"><a href="#" data-view="markdown">Markdown</a></li>
    <li><a href="#" data-view="preview">Preview</a></li>
  </ul>

  <%= model.text_area :text, class: 'form-control showdown-edit', id: 'markdown' %>

  <div class="showdown-content" id="preview" style="display: none;"></div>
</div>

<p class="help-block pull-right"><strong>**bold**</strong>&nbsp;&nbsp;&nbsp;<i>_italic_</i>&nbsp;&nbsp;&nbsp;<code>`code`</code>&nbsp;&nbsp;&nbsp;>quote&nbsp;&nbsp;&nbsp;&lt;link&gt;</p>



<script>
  var converter = new showdown.Converter();
  $(function () {
    $('.showdown-edit').on('keyup',function () {
      convert(this);
    });

    // allow tab press in textarea
    $('.showdown-edit').on('keydown',function (e) {
      var $this, end, start;
      if (e.keyCode === 9) {
        start = this.selectionStart;
        end = this.selectionEnd;
        $this = $(this);
        $this.val($this.val().substring(0, start) + "\t" + $this.val().substring(end));
        this.selectionStart = this.selectionEnd = start + 1;
        return false;
      }
    });

    convert('.showdown-edit');
  });

  function convert(id) {
    text = $(id).val();
    html = converter.makeHtml(text);
{'fraction_non_alphanumeric': 0.22053808260704813, 'fraction_numerical': 0.0022735884804850324, 'mean_word_length': 3.5993031358885017, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 53, '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': '2128077', 'n_tokens_mistral': 917, 'n_tokens_neox': 880, 'n_words': 152}