<commit_before>stripLinks = (formatted_content) ->
  $content = $("<span>#{formatted_content}</span>")
  $content.find('a').replaceWith ->
    $span = $("<span>#{@innerHTML}</span>")
    $span.addClass @className
    $span

  $content.html()

window.ReactFeedActivitiesAutoLoading = React.createBackboneClass
  displayName: 'ReactFeedActivitiesAutoLoading'
  changeOptions: 'sync'

  # this function loads more activities, if we're almost at the bottom of the list
  checkScrolledPosition: ->
    pixels_under_fold = $(document).height() - ($(window).scrollTop() + $(window).height())
    @model().loadMore() if pixels_under_fold < 700

  componentDidMount: ->
    $(window).on "scroll", @checkScrolledPosition
    @checkScrolledPosition()

  componentDidUpdate: -> @checkScrolledPosition()

  componentWillMount: ->
    if !@model().length
      @model().loadMore()

  componentWillUnmount: ->
    # createBackboneClass unbinds model
    $(window).off "scroll", @checkScrolledPosition

  render: ->
    _div [],
      if !@model().length && !@model().loading()
        'There aren\'t any comments.'<commit_msg>Double quotes to prevent escaping<commit_after>stripLinks = (formatted_content) ->
  $content = $("<span>#{formatted_content}</span>")
  $content.find('a').replaceWith ->
    $span = $("<span>#{@innerHTML}</span>")
    $span.addClass @className
    $span

  $content.html()

window.ReactFeedActivitiesAutoLoading = React.createBackboneClass
  displayName: 'ReactFeedActivitiesAutoLoading'
  changeOptions: 'sync'

  # this function loads more activities, if we're almost at the bottom of the list
  checkScrolledPosition: ->
    pixels_under_fold = $(document).height() - ($(window).scrollTop() + $(window).height())
    @model().loadMore() if pixels_under_fold < 700

  componentDidMount: ->
    $(window).on "scroll", @checkScrolledPosition
    @checkScrolledPosition()

  componentDidUpdate: -> @checkScrolledPosition()

  componentWillMount: ->
    if !@model().length
      @model().loadMore()

  componentWillUnmount: ->
    # createBackboneClass unbinds model
    $(window).off "scroll", @checkScrolledPosition

  render: ->
    _div [],
      if !@model().length && !@model().loading()
        "There aren\'t any comments."
{'fraction_non_alphanumeric': 0.1534344335414808, 'fraction_numerical': 0.0026761819803746653, 'mean_word_length': 4.252927400468384, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 27, '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': '5558265', 'n_tokens_mistral': 672, 'n_tokens_neox': 660, 'n_words': 137}