diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-03-02 17:21:43 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-03-02 17:21:43 +0300 |
commit | d95ac1b67f155b507da88685496e36cd64fdb435 (patch) | |
tree | af9eaefd6bfb40b9eb69e0f36c0ac864cfeac174 | |
parent | bb062ebdb68e5d4d9a92339948ddaaa68cdcf36c (diff) | |
parent | 6fd28ff24472b87802bf88d5306bbfebbf22f7d6 (diff) |
Merge branch 'dm-group-reference-full-name' into 'master'
Use full group name in GFM group reference title
See merge request !9642
-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 |