Modification in parse_urls in both layout.rb and theme.rb
This commit is contained in:
parent
25355e9c7f
commit
b2c0047d0f
|
@ -29,9 +29,12 @@ class Layout < DesignFile
|
|||
self.remove_file_orig!
|
||||
names = []
|
||||
images = self.design.images
|
||||
content.scan(/(?<=\<img src=)(.*?)(?=[ \t]|\/\>)/){
|
||||
html_name = nil
|
||||
content.scan(/(?<=\<img)(.*?)(?=\/\>)/){
|
||||
$1.gsub(' ','').scan(/(?<=src=\")(.*?)(?=\")/){
|
||||
html_name = $1
|
||||
name = File.basename(html_name).gsub(/[\\\"]/, '').strip
|
||||
}
|
||||
name = File.basename(html_name).gsub(/[\\\"]/, '')
|
||||
file_name = images.detect{ |i| i.file_filename.eql?(name) }.file_url rescue nil
|
||||
names << [html_name, file_name]
|
||||
}
|
||||
|
|
|
@ -11,9 +11,9 @@ class Theme < Stylesheet
|
|||
self.remove_file_orig!
|
||||
names = []
|
||||
images = self.design.images
|
||||
content.scan(/(?<=url\()(.*?)(?=\))/){
|
||||
css_name = $1
|
||||
name = File.basename(css_name).gsub(/[\\\"]/, '').strip
|
||||
content.scan(/(?<=url)(.*?)(?=\))/){
|
||||
css_name = $1.gsub(' ','').gsub('(','')
|
||||
name = File.basename(css_name).gsub(/[\\\"]/, '')
|
||||
file_name = images.detect{ |i| i.file_filename.eql?(name) }.file_url rescue nil
|
||||
names << [css_name, file_name]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue