修复:readme 修复
This commit is contained in:
parent
b551f97c54
commit
5a2e642579
|
@ -108,8 +108,8 @@ module RepositoriesHelper
|
|||
file_path = readme_path.include?('/') ? readme_path.gsub("/#{readme_name}", '') : readme_path.gsub("#{readme_name}", '')
|
||||
return nil if str.blank?
|
||||
content = Base64.decode64(str).force_encoding('UTF-8')
|
||||
s_regex = /\[.*?\]\((.*?)\)/
|
||||
src_regex = /src=\"(.*?)\"/
|
||||
s_regex = /\s\[.*?\]\((.*?)\)\s/
|
||||
src_regex = /\ssrc=\"(.*?)\"\s/
|
||||
ss = content.to_s.scan(s_regex)
|
||||
ss_src = content.to_s.scan(src_regex)
|
||||
total_sources = ss + ss_src
|
||||
|
|
|
@ -2,7 +2,7 @@ if @project.forge?
|
|||
is_dir = @sub_entries.is_a?(Array)
|
||||
file_name = entry['name']
|
||||
file_type = file_name.starts_with?('.') ? file_name[1..-1] : File.extname(file_name.to_s)[1..-1]
|
||||
direct_download = ["makefile","dockerfile"].exclude?(file_name.to_s.downcase) && download_type(file_type)
|
||||
direct_download = %w(makefile dockerfile readme).exclude?(file_name.to_s.downcase) && download_type(file_type)
|
||||
image_type = image_type?(file_type)
|
||||
json.name file_name
|
||||
json.sha entry['sha']
|
||||
|
|
Loading…
Reference in New Issue