diff options
-rw-r--r-- | changelogs/unreleased/dm-group-reference-full-name.yml | 4 | ||||
-rw-r--r-- | lib/banzai/filter/user_reference_filter.rb | 2 | ||||
-rw-r--r-- | spec/lib/banzai/filter/user_reference_filter_spec.rb | 6 |
3 files changed, 11 insertions, 1 deletions
diff --git a/changelogs/unreleased/dm-group-reference-full-name.yml b/changelogs/unreleased/dm-group-reference-full-name.yml new file mode 100644 index 00000000000..f445d955529 --- /dev/null +++ b/changelogs/unreleased/dm-group-reference-full-name.yml @@ -0,0 +1,4 @@ +--- +title: Use full group name in GFM group reference title +merge_request: +author: diff --git a/lib/banzai/filter/user_reference_filter.rb b/lib/banzai/filter/user_reference_filter.rb index c973897f420..849e1142841 100644 --- a/lib/banzai/filter/user_reference_filter.rb +++ b/lib/banzai/filter/user_reference_filter.rb @@ -133,7 +133,7 @@ module Banzai data = data_attribute(group: namespace.id) content = link_content || Group.reference_prefix + group - link_tag(url, data, content, namespace.name) + link_tag(url, data, content, namespace.full_name) end def link_to_user(user, namespace, link_content: nil) diff --git a/spec/lib/banzai/filter/user_reference_filter_spec.rb b/spec/lib/banzai/filter/user_reference_filter_spec.rb index d5d128c1907..9873774909e 100644 --- a/spec/lib/banzai/filter/user_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/user_reference_filter_spec.rb @@ -123,6 +123,12 @@ describe Banzai::Filter::UserReferenceFilter, lib: true do expect(doc.css('a').first.attr('href')).to eq urls.group_url(group) end + + it 'has the full group name as a title' do + doc = reference_filter("Hey #{reference}") + + expect(doc.css('a').first.attr('title')).to eq group.full_name + end end it 'links with adjacent text' do |