diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index f2cab2840d4da5162169ff77fb4a8cbfc8171c23..803578f191193a087c94fcde9d50a0e5aacd5e1b 100644 --- a/app/helpers/gitlab_markdown_helper.rb +++ b/app/helpers/gitlab_markdown_helper.rb @@ -45,6 +45,8 @@ module GitlabMarkdownHelper end def markdown(text, context = {}) + return unless text.present? + context.merge!( path: @path, project: @project, @@ -59,6 +61,8 @@ module GitlabMarkdownHelper # TODO (rspeicher): Remove all usages of this helper and just call `markdown` # with a custom pipeline depending on the content being rendered def gfm(text, options = {}) + return unless text.present? + options.merge!( path: @path, project: @project, diff --git a/app/views/events/_event_issue.atom.haml b/app/views/events/_event_issue.atom.haml index 4259f64c19102a11f7543903e53ce20e1ec6ef9f..4e8d70e4e9d80136258684a121c8c4caffd6fa14 100644 --- a/app/views/events/_event_issue.atom.haml +++ b/app/views/events/_event_issue.atom.haml @@ -1,3 +1,2 @@ %div{xmlns: "http://www.w3.org/1999/xhtml"} - - if issue.description.present? - = markdown(issue.description, xhtml: true, reference_only_path: false, project: issue.project) + = markdown(issue.description, xhtml: true, reference_only_path: false, project: issue.project) diff --git a/app/views/events/_event_merge_request.atom.haml b/app/views/events/_event_merge_request.atom.haml index e8ed13df783952f4a0b10d3ecd73b86c915eabab..db2b3550c499449c60200cc319f735bd72e5c5ef 100644 --- a/app/views/events/_event_merge_request.atom.haml +++ b/app/views/events/_event_merge_request.atom.haml @@ -1,3 +1,2 @@ %div{xmlns: "http://www.w3.org/1999/xhtml"} - - if merge_request.description.present? - = markdown(merge_request.description, xhtml: true, reference_only_path: false, project: merge_request.project) + = markdown(merge_request.description, xhtml: true, reference_only_path: false, project: merge_request.project)