<commit_before>
$(document).ready(function () {
  var doc = $('#doc');
  var html = marked(doc.html(), {
    highlight: function (code, lang) {
      // allow ```none to signal that we shouldn't highlight a block at all
      if (lang != 'none') {
        var res = prettyPrintOne(code, lang);
        if (res) {
          return res;
        }
      }
      return code;
    }
  });
  var p = doc.parentElement;
  doc.replaceWith($(html));

  // Populate the side nav
  var nav = $('#sidenav');
  var headings = {};

  $('h1,h2,h3,h4,h5,h6', p).each(function () {
    var id = $(this).text();

    $(this).attr('id', id);

    var text = $(this).text();
    var li = $('<li/>');
    li.append(
      $('<a/>', {
        href: '#'+id,
        title: text
      }).text(text)
    );
    nav.append(li);
  });

});<commit_msg>fix doc id generation for headings with spaces<commit_after>
$(document).ready(function () {
  var doc = $('#doc');
  var html = marked(doc.html(), {
    highlight: function (code, lang) {
      // allow ```none to signal that we shouldn't highlight a block at all
      if (lang != 'none') {
        var res = prettyPrintOne(code, lang);
        if (res) {
          return res;
        }
      }
      return code;
    }
  });
  var p = doc.parentElement;
  doc.replaceWith($(html));

  // Populate the side nav
  var nav = $('#sidenav');
  var headings = {};

  $('h1,h2,h3,h4,h5,h6', p).each(function () {
    var id = $(this).text().replace(/[ ]+/g, "-");

    $(this).attr('id', id);

    var text = $(this).text();
    var li = $('<li/>');
    li.append(
      $('<a/>', {
        href: '#'+id,
        title: text
      }).text(text)
    );
    nav.append(li);
  });

});
{'fraction_non_alphanumeric': 0.20786846741045215, 'fraction_numerical': 0.007046388725778039, 'mean_word_length': 2.1555555555555554, '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': '5853022', 'n_tokens_mistral': 595, 'n_tokens_neox': 585, 'n_words': 150}