Sha256: 6382d3363c3f216e159e303017b8c9e0aa0cf8dc7217fb0344250820fc0b2088
Contents?: true
Size: 788 Bytes
Versions: 16
Compression:
Stored size: 788 Bytes
Contents
# frozen_string_literal: true module Thredded class AtNotificationExtractor def initialize(post) @post = post end # @return [Array<Thredded.user_class>] def run view_context = Thredded::ApplicationController.new.view_context # Do not highlight @-mentions at first, because: # * When parsing, @-mentions within <a> tags will not be considered. # * We can't always generate the user URL here because request.host is not available. html = @post.filtered_content(view_context, users_provider: nil) Thredded::HtmlPipeline::AtMentionFilter.new( html, view_context: view_context, users_provider: ::Thredded::UsersProvider, users_provider_scope: @post.readers ).mentioned_users end end end
Version data entries
16 entries across 16 versions & 1 rubygems