Commit a0de879d authored by Robert Speicher's avatar Robert Speicher

Merge branch 'allow-emoji-in-references' into 'master'

Allow references to labels and milestones to contain emoji

Closes #37762, #53756, and #40728

See merge request gitlab-org/gitlab-ce!29284
parents 20bb0d66 1617aa27
---
title: Allow references to labels and milestones to contain emoji
merge_request: 29284
author:
type: changed
...@@ -25,7 +25,6 @@ module Banzai ...@@ -25,7 +25,6 @@ module Banzai
Filter::VideoLinkFilter, Filter::VideoLinkFilter,
Filter::ImageLazyLoadFilter, Filter::ImageLazyLoadFilter,
Filter::ImageLinkFilter, Filter::ImageLinkFilter,
Filter::EmojiFilter,
Filter::TableOfContentsFilter, Filter::TableOfContentsFilter,
Filter::AutolinkFilter, Filter::AutolinkFilter,
Filter::ExternalLinkFilter, Filter::ExternalLinkFilter,
...@@ -34,6 +33,7 @@ module Banzai ...@@ -34,6 +33,7 @@ module Banzai
*reference_filters, *reference_filters,
Filter::EmojiFilter,
Filter::TaskListFilter, Filter::TaskListFilter,
Filter::InlineDiffFilter, Filter::InlineDiffFilter,
......
...@@ -117,4 +117,27 @@ describe Banzai::Pipeline::GfmPipeline do ...@@ -117,4 +117,27 @@ describe Banzai::Pipeline::GfmPipeline do
expect(output).not_to include("javascript") expect(output).not_to include("javascript")
end end
end end
describe 'emoji in references' do
set(:project) { create(:project, :public) }
let(:emoji) { '💯' }
it 'renders a label reference with emoji inside' do
create(:label, project: project, name: emoji)
output = described_class.to_html("#{Label.reference_prefix}\"#{emoji}\"", project: project)
expect(output).to include(emoji)
expect(output).to include(Gitlab::Routing.url_helpers.project_issues_path(project, label_name: emoji))
end
it 'renders a milestone reference with emoji inside' do
milestone = create(:milestone, project: project, title: emoji)
output = described_class.to_html("#{Milestone.reference_prefix}\"#{emoji}\"", project: project)
expect(output).to include(emoji)
expect(output).to include(Gitlab::Routing.url_helpers.milestone_path(milestone))
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment