<commit_before># The mentions plugin takes care of highlighting the @username and passing the users to the atwho plugin.
# The show_activities addMessage method is responsible for changing the look of a message body when a user is mentioned
class Kandan.Plugins.Mentions
  @options:
    regex: /(^|\s)@\S*/gm

    template: _.template '''<span class="mention"><%= mention %></span>'''

  @init: ()->
    Kandan.Data.ActiveUsers.registerCallback "change", (data)=>
      @initUsersMentions(data.extra.active_users)

    Kandan.Modifiers.register @options.regex, (message, activity) =>
      for mention in message.match(@options.regex)
        replacement = @options.template({mention: mention})<commit_msg>Trimming the whitespace from @username mentions<commit_after># The mentions plugin takes care of highlighting the @username and passing the users to the atwho plugin.
# The show_activities addMessage method is responsible for changing the look of a message body when a user is mentioned
class Kandan.Plugins.Mentions
  @options:
    regex: /(^|\s)@\S*/gm

    template: _.template '''<span class="mention"><%= mention.trim() %></span>'''

  @init: ()->
    Kandan.Data.ActiveUsers.registerCallback "change", (data)=>
      @initUsersMentions(data.extra.active_users)

    Kandan.Modifiers.register @options.regex, (message, activity) =>
      for mention in message.match(@options.regex)
        replacement = @options.template({mention: mention})
{'fraction_non_alphanumeric': 0.12250516173434274, 'fraction_numerical': 0.0, 'mean_word_length': 4.405204460966543, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '3830351', 'n_tokens_mistral': 426, 'n_tokens_neox': 411, 'n_words': 132}