lib/gitlab/markdown/user_reference_filter.rb
# Replace `@user` user references in text with links to the referenced
# user's profile page.
#
# text - String text to replace references in.
#
# Returns a String with `@user` references replaced with links. All links
# have `gfm` and `gfm-project_member` class names attached for styling.
Replace `@user` user references in text with links to the referenced
user's profile page.

String text to replace references in.

Returns a String with `@user` references replaced with links. All links
have `gfm` and `gfm-project_member` class names attached for styling.
Replace ` @user ` user references in text with links to the referenced user ' s profile page . String text to replace references in . Returns a String with ` @user ` references replaced with links . All links have ` gfm ` and ` gfm - project_member ` class names attached for styling .
def user_link_filter(text)
        self.class.references_in(text) do |match, username|
          if username == 'all'
            link_to_all
          elsif namespace = Namespace.find_by(path: username)
            link_to_namespace(namespace) || match
          else
            match
          end
        end
      end
def user_link_filter ( text ) self . class . references_in ( text ) do | match , username | if username == 'all' link_to_all elsif namespace = Namespace . find_by ( path : username ) link_to_namespace ( namespace ) || match else match end end end
Replace `@user` user references in text with links to the referenced
user's profile page.
Replace ` @user ` user references in text with links to the referenced user ' s profile page .
text
<not_specific>