diff options
author | Satish Perala <satish@cybrilla.com> | 2016-08-26 09:15:09 +0530 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-06-20 14:13:23 +0100 |
commit | a165a4452eb7430715d672191411c76de7e7f659 (patch) | |
tree | a399c208d331df11c4fe7937cac4bac583f423c8 | |
parent | 9170aab92e616a6f6d3ddfc4cf8326cba0e4a1a8 (diff) | |
download | gitlab-ce-a165a4452eb7430715d672191411c76de7e7f659.tar.gz |
Checking for the presense of markdown text
-rw-r--r-- | lib/markdown_utils.rb | 6 |
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 |