diff options
Diffstat (limited to 'lib/banzai/filter/markdown_pre_escape_filter.rb')
-rw-r--r-- | lib/banzai/filter/markdown_pre_escape_filter.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/banzai/filter/markdown_pre_escape_filter.rb b/lib/banzai/filter/markdown_pre_escape_filter.rb index 9fd77c48659..bedc2d0fd04 100644 --- a/lib/banzai/filter/markdown_pre_escape_filter.rb +++ b/lib/banzai/filter/markdown_pre_escape_filter.rb @@ -24,8 +24,10 @@ module Banzai # This filter does the initial surrounding, and MarkdownPostEscapeFilter # does the conversion into span tags. class MarkdownPreEscapeFilter < HTML::Pipeline::TextFilter - ASCII_PUNCTUATION = %r{([\\][!"#$%&'()*+,-./:;<=>?@\[\\\]^_`{|}~])}.freeze - LITERAL_KEYWORD = 'cmliteral' + # We just need to target those that are special GitLab references + REFERENCE_CHARACTERS = '@#!$&~%^' + ASCII_PUNCTUATION = %r{([\\][#{REFERENCE_CHARACTERS}])}.freeze + LITERAL_KEYWORD = 'cmliteral' def call return @text unless Feature.enabled?(:honor_escaped_markdown, context[:group] || context[:project]&.group) |