diff options
Diffstat (limited to 'lib/gitlab/file_markdown_link_builder.rb')
-rw-r--r-- | lib/gitlab/file_markdown_link_builder.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/file_markdown_link_builder.rb b/lib/gitlab/file_markdown_link_builder.rb index 5386656efe7..180140e7da2 100644 --- a/lib/gitlab/file_markdown_link_builder.rb +++ b/lib/gitlab/file_markdown_link_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Builds the markdown link of a file # It needs the methods filename and secure_url (final destination url) to be defined. module Gitlab @@ -8,7 +10,7 @@ module Gitlab return unless name = markdown_name markdown = "[#{name.gsub(']', '\\]')}](#{secure_url})" - markdown.prepend("!") if image_or_video? || dangerous? + markdown = "!#{markdown}" if image_or_video? || dangerous? markdown end |