diff options
author | Kerri Miller <kerrizor@kerrizor.com> | 2019-06-03 14:52:58 -0700 |
---|---|---|
committer | Kerri Miller <kerrizor@kerrizor.com> | 2019-06-05 16:19:45 -0700 |
commit | fb3d40cb61eaff46bc10d3d49d499bd5d34a6be1 (patch) | |
tree | e809169c40e27143b19897ead3cdb3f1466b4009 /lib | |
parent | f44eba8c0e537362ccf362480517f12ee7c73130 (diff) | |
download | gitlab-ce-fb3d40cb61eaff46bc10d3d49d499bd5d34a6be1.tar.gz |
Extend #parse to accept a suggestions_filter_enabled param
This will allow the front end to specify the behavior as needed.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/diff/suggestions_parser.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/diff/suggestions_parser.rb b/lib/gitlab/diff/suggestions_parser.rb index c8c03d5d001..6e17ffaf6ff 100644 --- a/lib/gitlab/diff/suggestions_parser.rb +++ b/lib/gitlab/diff/suggestions_parser.rb @@ -10,10 +10,12 @@ module Gitlab # Returns an array of Gitlab::Diff::Suggestion which represents each # suggestion in the given text. # - def parse(text, position:, project:) + def parse(text, position:, project:, supports_suggestion: true) return [] unless position.complete? - html = Banzai.render(text, project: nil, no_original_data: true) + html = Banzai.render(text, project: nil, + no_original_data: true, + suggestions_filter_enabled: supports_suggestion) doc = Nokogiri::HTML(html) suggestion_nodes = doc.search('pre.suggestion') |