<commit_before>(function() {
  // Extend the <a> tag with history.pushState()
  //
  // <a is="pushstate-anchor" href="/path" [title="New Page Title"] [state="{'message':'New State!'}"]>title</a>

  var HTMLPushStateAnchorElement = Object.create(HTMLAnchorElement.prototype);

  function pushStateAnchorEventListener(event) {
    // open in new tab
    if (event.ctrlKey || event.metaKey || event.which === 2) {
      return;
    }

    var href = this.getAttribute('href');
    if (!href) {
      return;
    }

    // don't pushState if the URL is for a different host
    if (href.indexOf('http') === 0 && window.location.host !== new URL(href).host) {
      return;
    }

    // push state into the history stack
    window.history.pushState(JSON.parse(this.getAttribute('state')) || window.history.state, this.getAttribute('title'), href);

    // dispatch a popstate event<commit_msg>Prevent pushState on secondary mouse clicks<commit_after>(function() {
  // Extend the <a> tag with history.pushState()
  //
  // <a is="pushstate-anchor" href="/path" [title="New Page Title"] [state="{'message':'New State!'}"]>title</a>

  var HTMLPushStateAnchorElement = Object.create(HTMLAnchorElement.prototype);

  function pushStateAnchorEventListener(event) {
    // open in new tab or open context menu (workaround for Firefox)
    if (event.ctrlKey || event.metaKey || event.which === 2 || event.which === 3) {
      return;
    }

    var href = this.getAttribute('href');
    if (!href) {
      return;
    }

    // don't pushState if the URL is for a different host
    if (href.indexOf('http') === 0 && window.location.host !== new URL(href).host) {
      return;
    }

    // push state into the history stack
    window.history.pushState(JSON.parse(this.getAttribute('state')) || window.history.state, this.getAttribute('title'), href);

    // dispatch a popstate event
{'fraction_non_alphanumeric': 0.15540180947312401, 'fraction_numerical': 0.0026609898882384245, 'mean_word_length': 3.3518518518518516, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5489578', 'n_tokens_mistral': 565, 'n_tokens_neox': 547, 'n_words': 147}