Commit a81b322e authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents f2fb94a7 a0de879d
---
title: Allow references to labels and milestones to contain emoji
merge_request: 29284
author:
type: changed
......@@ -27,7 +27,6 @@ module Banzai
Filter::VideoLinkFilter,
Filter::ImageLazyLoadFilter,
Filter::ImageLinkFilter,
Filter::EmojiFilter,
Filter::TableOfContentsFilter,
Filter::AutolinkFilter,
Filter::ExternalLinkFilter,
......@@ -36,6 +35,7 @@ module Banzai
*reference_filters,
Filter::EmojiFilter,
Filter::TaskListFilter,
Filter::InlineDiffFilter,
......
......@@ -117,4 +117,27 @@ describe Banzai::Pipeline::GfmPipeline do
expect(output).not_to include("javascript")
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
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