Commit f8e1fb75 authored by Brett Walker's avatar Brett Walker

Escaped markdown not interpreted as shortcuts

Changelog: added
parent a9a7f192
---
name: honor_escaped_markdown
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45922
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/300531
milestone: '13.9'
type: development
group: 'group::project management'
default_enabled: false
......@@ -30,8 +30,6 @@ module Banzai
LITERAL_KEYWORD = 'cmliteral'
def call
return @text unless Feature.enabled?(:honor_escaped_markdown, context[:group] || context[:project]&.group)
@text.gsub(ASCII_PUNCTUATION) do |match|
# The majority of markdown does not have literals. If none
# are found, we can bypass the post filter
......
......@@ -17,20 +17,6 @@ RSpec.describe Banzai::Pipeline::PlainMarkdownPipeline do
result
end
context 'when feature flag honor_escaped_markdown is disabled' do
before do
stub_feature_flags(honor_escaped_markdown: false)
end
it 'does not escape the markdown' do
result = described_class.call(%q(\!), project: project)
output = result[:output].to_html
expect(output).to eq('<p data-sourcepos="1:1-1:2">!</p>')
expect(result[:escaped_literals]).to be_falsey
end
end
describe 'CommonMark tests', :aggregate_failures do
it 'converts all reference punctuation to literals' do
reference_chars = Banzai::Filter::MarkdownPreEscapeFilter::REFERENCE_CHARACTERS
......
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