summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSatish Perala <satish@cybrilla.com>2016-08-26 09:15:09 +0530
committerSean McGivern <sean@gitlab.com>2018-06-20 14:13:23 +0100
commita165a4452eb7430715d672191411c76de7e7f659 (patch)
treea399c208d331df11c4fe7937cac4bac583f423c8
parent9170aab92e616a6f6d3ddfc4cf8326cba0e4a1a8 (diff)
downloadgitlab-ce-a165a4452eb7430715d672191411c76de7e7f659.tar.gz
Checking for the presense of markdown text
-rw-r--r--lib/markdown_utils.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/markdown_utils.rb b/lib/markdown_utils.rb
index a5cf035018b..959eda12115 100644
--- a/lib/markdown_utils.rb
+++ b/lib/markdown_utils.rb
@@ -3,6 +3,10 @@ class MarkdownUtils
# Convert image urls in the markdown text to absolute urls
def self.absolute_image_urls(markdown_text)
- markdown_text.gsub(/!\[(.*?)\]\((.*?)\)/, "![\\1](#{Settings.gitlab.url}\\2)")
+ if markdown_text.present?
+ markdown_text.gsub(/!\[(.*?)\]\((.*?)\)/, "![\\1](#{Settings.gitlab.url}\\2)")
+ else
+ markdown_text
+ end
end
end