<commit_before>/* global jQuery */
(function ($) {
  $.fn.removeAria = function () {
    return this.map(function () {
      var clone = $(this).clone()
      clone.find('[aria-hidden="true"]').remove()
      return clone
    })
  }

  $.fn.fixAnchors = function () {
    return this.each(function () {
      $(this).find('h1 a[aria-hidden="true"], h2 a[aria-hidden="true"], h3 a[aria-hidden="true"], h4 a[aria-hidden="true"], h5 a[aria-hidden="true"], h6 a[aria-hidden="true"]').each(function () {
        var anchor = $(this)
        if (!anchor.is('[title]')) {
          var header = anchor.parent()
          var title = header.removeAria().text().trim()
          anchor.attr('title', title)
        }
      })
    })
  }

  $.fn.fixFootnotes = function () {
    return this.each(function () {
      var body = $(this)
      body.find('.footnote-ref a').each(function () {
        var link = $(this)
        var id = link.attr('href')
        var note = body.find(id)
        var text = note.text().replace(/(\s*\u21a9\s*)+$/, '')
        link.attr('title', text)
      })
    })
  }

  $.fn.addTitle = function () {
    return this.each(function () {
      var title = $(this).find('title')
      if (title.length === 0) {
        title = $('title')
      }
      var header = $(this).find('h1, h2, h3, h4, h5, h6').first()
      if (header.length > 0) {
        var txt = header.removeAria().text().trim()
        title.html(txt)
      }
    })
  }
}(jQuery))<commit_msg>Extract title from emphasized text<commit_after>/* global jQuery */
(function ($) {
  $.fn.removeAria = function () {
    return this.map(function () {
      var clone = $(this).clone()
      clone.find('[aria-hidden="true"]').remove()
      return clone
    })
  }

  $.fn.fixAnchors = function () {
    return this.each(function () {
      $(this).find('h1 a[aria-hidden="true"], h2 a[aria-hidden="true"], h3 a[aria-hidden="true"], h4 a[aria-hidden="true"], h5 a[aria-hidden="true"], h6 a[aria-hidden="true"]').each(function () {
        var anchor = $(this)
        if (!anchor.is('[title]')) {
          var header = anchor.parent()
          var title = header.removeAria().text().trim()
          anchor.attr('title', title)
        }
      })
    })
  }

  $.fn.fixFootnotes = function () {
    return this.each(function () {
      var body = $(this)
      body.find('.footnote-ref a').each(function () {
        var link = $(this)
        var id = link.attr('href')
        var note = body.find(id)
        var text = note.text().replace(/(\s*\u21a9\s*)+$/, '')
        link.attr('title', text)
      })
    })
  }

  $.fn.addTitle = function () {
    return this.each(function () {
      var title = $(this).find('title')
      if (title.length === 0) {
        title = $('title')
      }
      var header = $(this).find('h1, h2, h3, h4, h5, h6, strong, b, em, i, p').first()
      if (header.length > 0) {
        var txt = header.removeAria().text().trim()
        title.html(txt)
      }
    })
  }
}(jQuery))
{'fraction_non_alphanumeric': 0.20633333333333334, 'fraction_numerical': 0.011333333333333334, 'mean_word_length': 2.2268817204301077, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6216590', 'n_tokens_mistral': 1010, 'n_tokens_neox': 995, 'n_words': 196}