Browse Source

修复: readme无法正常跳转目录的问题

pull/313/head
yystopf 4 years ago
parent
commit
ce467736a7
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      app/helpers/repositories_helper.rb

+ 1
- 2
app/helpers/repositories_helper.rb View File

@@ -104,8 +104,7 @@ module RepositoriesHelper
# 链接直接跳过不做替换
next if s_content.starts_with?('http://') || s_content.starts_with?('https://') || s_content.starts_with?('mailto:') || s_content.blank?
ext = File.extname(s_content)[1..-1]
if image_type?(ext) || download_type(ext)
if (image_type?(ext) || download_type(ext)) && !s_content.to_s.end_with?('/')
s_content = File.expand_path(s_content, file_path)
s_content = s_content.split("#{Rails.root}/")[1]
# content = content.gsub(s[0], "/#{s_content}")


Loading…
Cancel
Save