diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-09-03 16:38:35 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-09-03 16:38:35 -0400 |
commit | 4bd92e681e0a6d2a8d7e1ef44d9f248394833d09 (patch) | |
tree | dbd9edc770742f1404768232b6c4aa943eef467b /app/helpers/gitlab_markdown_helper.rb | |
parent | e5d89c1084d1c1f29bfabe50718debf8867f760e (diff) | |
download | gitlab-ce-4bd92e681e0a6d2a8d7e1ef44d9f248394833d09.tar.gz |
Return early from markdown and gfm when text is empty
Diffstat (limited to 'app/helpers/gitlab_markdown_helper.rb')
-rw-r--r-- | app/helpers/gitlab_markdown_helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index f2cab2840d4..803578f1911 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, |