fixed readme中图片链接问号处理
This commit is contained in:
parent
37d1db6c82
commit
cc4452e4ad
|
@ -136,6 +136,7 @@ module RepositoriesHelper
|
||||||
# 链接直接跳过不做替换
|
# 链接直接跳过不做替换
|
||||||
next if s_content.starts_with?('http://') || s_content.starts_with?('https://') || s_content.starts_with?('mailto:') || s_content.blank?
|
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]
|
ext = File.extname(s_content)[1..-1]
|
||||||
|
ext = ext.split("?")[0] if ext.include?("?")
|
||||||
if (image_type?(ext) || download_type(ext)) && !ext.blank?
|
if (image_type?(ext) || download_type(ext)) && !ext.blank?
|
||||||
s_content = File.expand_path(s_content, file_path)
|
s_content = File.expand_path(s_content, file_path)
|
||||||
s_content = s_content.split("#{Rails.root}/")[1]
|
s_content = s_content.split("#{Rails.root}/")[1]
|
||||||
|
|
Loading…
Reference in New Issue