<commit_before><?php

/*
 * PAGINATION
 *
  <ol class="pagination">
    <li class=pagination__first>First</li>
    <li class=pagination__prev>Previous</li>
    <li><a href=/page/1>1</a></li>
    <li><a href=/page/2>2</a></li>
    <li class=current><a href=/page/3>3</a></li>
    <li><a href=/page/4>4</a></li>
    <li><a href=/page/5>5</a></li>
    <li class=pagination__next><a href=/page/next>Next</a></li>
    <li class=pagination__last><a href=/page/last>Last</a></li>
   </ol>
 */

function pagination( $pages = '', $range = 2 ) {
  $showitems = ( $range * 2 ) + 1;

  global $paged;

  if ( empty( $paged ) ) { $paged = 1; }

  if ( $pages == '' ) {
    global $wp_query;
    $pages = $wp_query->max_num_pages;
    if ( !$pages ) {
      $pages = 1;
    }
  }

  if ( $pages != 1 ) {
    echo '<ol class="pagination">';
    if ( $paged > 1 ) echo '<li class="pagination__prev"><a href="' . get_pagenum_link( $paged - 1 ) . '" rel="prev">Previous</a></li>';
    if ( $paged > 2 && $paged > ( $range + 1 ) && $showitems < $pages ) echo '<li><a href="' . get_pagenum_link(1) . '">1</a></li>\n<li class="pagination__more"><span>&#8230;</span></li>';

    for ( $i = 1; $i <= $pages; $i++ ) {
      if ( 1 != $pages && ( !( $i >= ( $paged + $range + 1 ) || $i <= ( $paged - $range - 1 ) ) || $pages <= $showitems ) ) {
        echo ( $paged == $i ) ? '<li class="pagination__curr"><span>' . $i . '</span>' : '<a href="' . get_pagenum_link( $i ) . '">' . $i . '</a>'; // This line displays the page number links
      }
    }

    if ( $paged < ( $pages - 1 ) && ( $paged + $range - 1 ) < $pages && $showitems < $pages ) echo '<li class="pagination__more"><span>&#8230;</span></li>\n<li><a href="' . get_pagenum_link( $pages ) . '">' . $pages . '</a></li>';
    if ( $paged < $pages ) echo '<li class="pagination__next"><a href="' . get_pagenum_link( $paged + 1 ) . '" rel="next">Next</a></li>';
    echo '</ol>';
  }
}<commit_msg>Fixed <li>s and new lines in pagination function<commit_after><?php

/*
 * PAGINATION
 *
  <ol class="pagination">
    <li class=pagination__first>First</li>
    <li class=pagination__prev>Previous</li>
    <li><a href=/page/1>1</a></li>
    <li><a href=/page/2>2</a></li>
    <li class=current><a href=/page/3>3</a></li>
    <li><a href=/page/4>4</a></li>
    <li><a href=/page/5>5</a></li>
    <li class=pagination__next><a href=/page/next>Next</a></li>
    <li class=pagination__last><a href=/page/last>Last</a></li>
   </ol>
 */

function pagination( $pages = '', $range = 2 ) {
  $showitems = ( $range * 2 ) + 1;

  global $paged;

  if ( empty( $paged ) ) { $paged = 1; }

  if ( $pages == '' ) {
    global $wp_query;
    $pages = $wp_query->max_num_pages;
    if ( !$pages ) {
      $pages = 1;
    }
  }

  if ( $pages != 1 ) {
    echo '<ol class="pagination">';
    if ( $paged > 1 ) echo '<li class="pagination__prev"><a href="' . get_pagenum_link( $paged - 1 ) . '" rel="prev">Previous</a></li>';
    if ( $paged > 2 && $paged > ( $range + 1 ) && $showitems < $pages ) echo '<li><a href="' . get_pagenum_link(1) . '">1</a></li>' . "\n" . '<li class="pagination__more"><span>&#8230;</span></li>';

    for ( $i = 1; $i <= $pages; $i++ ) {
      if ( 1 != $pages && ( !( $i >= ( $paged + $range + 1 ) || $i <= ( $paged - $range - 1 ) ) || $pages <= $showitems ) ) {
        echo ( $paged == $i ) ? '<li class="pagination__curr"><span>' . $i . '</span></li>' : '<li><a href="' . get_pagenum_link( $i ) . '">' . $i . '</a></li>'; // This line displays the page number links
      }
    }

    if ( $paged < ( $pages - 1 ) && ( $paged + $range - 1 ) < $pages && $showitems < $pages ) echo '<li class="pagination__more"><span>&#8230;</span></li>' . "\n" . '<li><a href="' . get_pagenum_link( $pages ) . '">' . $pages . '</a></li>';
    if ( $paged < $pages ) echo '<li class="pagination__next"><a href="' . get_pagenum_link( $paged + 1 ) . '" rel="next">Next</a></li>';
    echo '</ol>';
  }
}
{'fraction_non_alphanumeric': 0.2604935131009921, 'fraction_numerical': 0.018824726532688883, 'mean_word_length': 2.8853754940711465, 'pattern_counts': {'":': 0, '<': 155, '<?xml version=': 0, '>': 147, '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': '2769672', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1542, 'n_words': 317}