修复:readme 修复

This commit is contained in:
yystopf 2023-03-16 11:33:39 +08:00
parent b551f97c54
commit 5a2e642579
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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']