diff options
Diffstat (limited to 'lib/gitlab/google_code_import')
-rw-r--r-- | lib/gitlab/google_code_import/importer.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/google_code_import/importer.rb b/lib/gitlab/google_code_import/importer.rb index 84ad1516571..8bdb46237fc 100644 --- a/lib/gitlab/google_code_import/importer.rb +++ b/lib/gitlab/google_code_import/importer.rb @@ -314,8 +314,12 @@ module Gitlab raw_attachments.map do |attachment| next if attachment["isDeleted"] - link = "https://storage.googleapis.com/google-code-attachments/#{@repo.name}/issue-#{issue_id}/comment-#{comment_id}/#{attachment["fileName"]}" - "[#{attachment["fileName"]}](#{link})" + filename = attachment["fileName"] + link = "https://storage.googleapis.com/google-code-attachments/#{@repo.name}/issue-#{issue_id}/comment-#{comment_id}/#{filename}" + + text = "[#{filename}](#{link})" + text = "!#{text}" if filename =~ /\.(png|jpg|jpeg|gif|bmp|tiff)\z/ + text end.compact end end |