summaryrefslogtreecommitdiff
path: root/app/helpers/gitlab_markdown_helper.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-09-03 16:38:35 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-09-03 16:38:35 -0400
commit4bd92e681e0a6d2a8d7e1ef44d9f248394833d09 (patch)
treedbd9edc770742f1404768232b6c4aa943eef467b /app/helpers/gitlab_markdown_helper.rb
parente5d89c1084d1c1f29bfabe50718debf8867f760e (diff)
downloadgitlab-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.rb4
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,