diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-06-12 10:28:58 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-06-12 10:28:58 +0100 |
commit | 0b080f8c8a81c6883582c417be199abc56086208 (patch) | |
tree | 52657388129959073b52bbb8f72ddfc26a042641 /lib/gitlab/diff | |
parent | 093b2f42c4efc1f679ec742e0a28145171127782 (diff) | |
parent | e206e66bbba9e36a75eb485f65c26f1d5a05e90f (diff) | |
download | gitlab-ce-0b080f8c8a81c6883582c417be199abc56086208.tar.gz |
Merge branch 'master' into generate-spans-for-sections
* master: (784 commits)
Update Serverless.gitlab-ci-yml to fix lint warning
Document when milestones and labels links are missing
Update git object deduplication overview
Apply tooltip on truncated commit title
Add link to import video
Update merge options for auto merge strategies
Update note style in various docs
Add link to Auto DevOps demo video
Add link to Groups video
Remove glossary content and make necessary doc edits to clarify terms
Docs for Gitlab Runner docker use of private registries
Metrics reports documentation is incomplete
Update issues/index.md with note on label priority sorting
API issues - minor cleanup of permission check
Fix gl_dropdown scrolling to top on assignee click
Final doc review
Remove docs for a removed ES rake task
Fixed markdown link in Docker compose note
Documented the Admin Area's *Groups* page
Docs: Updating issue data and actions doc
...
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r-- | lib/gitlab/diff/suggestion.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/diff/suggestions_parser.rb | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/diff/suggestion.rb b/lib/gitlab/diff/suggestion.rb index 027c7a31bcf..4a3ac2106e2 100644 --- a/lib/gitlab/diff/suggestion.rb +++ b/lib/gitlab/diff/suggestion.rb @@ -33,6 +33,8 @@ module Gitlab end def to_content + return "" if @text.blank? + # The parsed suggestion doesn't have information about the correct # ending characters (we may have a line break, or not), so we take # this information from the last line being changed (last 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') |