<commit_before>// source: http://slickmedia.co.uk/blog/glenns-blog/limit-number-of-characters-in-div-jquery-css/
$('li.posts p').each(function () {
  var len = $(this).text().length; // selects p element's text and length
  if ($(len > 300)) { // if length is greater than x
    $(this).text($(this).text().substring(0, 300) + '...'); // return `p` elements characters between 0 and x plux `...`

    $('a.readMore').on('click', function () {
      $('li.posts p').text($('li.post p').text().substring(300));
    });
  }
});

// `.text()` selects combined text contents of matched element
// `.substring(indexStart, indexEnd)` - returns part of string between the given indexes<commit_msg>not working yet, fixing during lunch<commit_after>// source: http://slickmedia.co.uk/blog/glenns-blog/limit-number-of-characters-in-div-jquery-css/
$('li.posts p').each(function () {
  var len = $(this).text().length; // selects p element's text and length
  if ($(len > 300)) { // if length is greater than x
    $(this).text($(this).text().substring(0, 300) + '...'); // return `p` elements characters between 0 and x plux `...`

  $('a.readMore').on('click', function () {
    $('li.posts p').show($('li.posts p').text(.substring(300));
  });
  }
});
// `.text()` selects combined text contents of matched element
// `.substring(indexStart, indexEnd)` - returns part of string between the given indexes
{'fraction_non_alphanumeric': 0.20946915351506457, 'fraction_numerical': 0.015781922525107604, 'mean_word_length': 3.603960396039604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '177195', 'n_tokens_mistral': 471, 'n_tokens_neox': 437, 'n_words': 118}