lib/epubmaker/content.rb in review-4.2.0 vs lib/epubmaker/content.rb in review-5.0.0

- old
+ new

@@ -1,8 +1,8 @@ # = content.rb -- Content object for EPUBMaker. # -# Copyright (c) 2010-2017 Kenshi Muto +# Copyright (c) 2010-2020 Kenshi Muto # # This program is free software. # You can distribute or modify this program under the terms of # the GNU LGPL, Lesser General Public License version 2.1. # For details of the GNU LGPL, see the file "COPYING". @@ -71,14 +71,15 @@ private # Complement other parameters by using file parameter. def complement if @id.nil? - @id = @file.gsub(%r{[\\/\. ]}, '-') + @id = @file.gsub(%r{[\\/. ]}, '-') end if @id =~ /\A[^a-z]/i @id = "rv-#{@id}" end + @id = CGI.escape(@id).gsub('%', '_25_') if !@file.nil? && @media.nil? @media = @file.sub(/.+\./, '').downcase end