修复:支持以.开头文件的代码预览

This commit is contained in:
yystopf 2023-02-15 11:30:33 +08:00
parent b799780637
commit 774210206e
1 changed files with 1 additions and 1 deletions

View File

@ -1,6 +1,6 @@
if @project.forge? if @project.forge?
file_name = entry['name'] file_name = entry['name']
file_type = File.extname(file_name.to_s)[1..-1] file_type = file_name.starts_with?('.') ? file_name[1..-1] : File.extname(file_name.to_s)[1..-1]
direct_download = file_name.to_s.downcase != "Makefile".downcase && download_type(file_type) direct_download = file_name.to_s.downcase != "Makefile".downcase && download_type(file_type)
image_type = image_type?(file_type) image_type = image_type?(file_type)
json.name file_name json.name file_name