merge pull request #300
This commit is contained in:
parent
9a25c06969
commit
a8f422ba42
2
.gitignore
vendored
2
.gitignore
vendored
@ -34,5 +34,5 @@ sites/
|
|||||||
permanent
|
permanent
|
||||||
doc/bushido
|
doc/bushido
|
||||||
*.swp
|
*.swp
|
||||||
|
/spec/dummy
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ module Locomotive
|
|||||||
def replace_images!(template)
|
def replace_images!(template)
|
||||||
return if template.blank?
|
return if template.blank?
|
||||||
|
|
||||||
template.gsub!(/\/samples\/(.*\.[a-zA-Z0-9]{3})/) do |match|
|
template.gsub!(/\/samples\/([^'"]+?\.[a-zA-Z0-9]{3})/) do |match|
|
||||||
name = File.basename($1)
|
name = File.basename($1)
|
||||||
|
|
||||||
if asset = site.assets.where(:source_filename => name).first
|
if asset = site.assets.where(:source_filename => name).first
|
||||||
|
@ -113,6 +113,7 @@ module Locomotive
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
self.replace_images!(attributes['content'])
|
||||||
element.content = attributes['content']
|
element.content = attributes['content']
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
BIN
spec/fixtures/themes/default.zip
vendored
BIN
spec/fixtures/themes/default.zip
vendored
Binary file not shown.
@ -73,7 +73,7 @@ describe Locomotive::Import::Job do
|
|||||||
|
|
||||||
it 'sets the editable text for a page from the site config file' do
|
it 'sets the editable text for a page from the site config file' do
|
||||||
page = @site.pages.where(:title => 'Contact').first
|
page = @site.pages.where(:title => 'Contact').first
|
||||||
page.find_editable_element('content', 'address').content.should == '<p>Our office address: 215 Vine Street, Scranton, PA 18503</p>'
|
page.find_editable_element('content', 'address').content.should match('<p>Our office address: 215 Vine Street, Scranton, PA 18503<br /><img src="/sites/[^/]+/assets/[^/]+/office.jpg" alt="office.jpg" /></p>')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sets the editable file for a page from the site config file' do
|
it 'sets the editable file for a page from the site config file' do
|
||||||
|
Loading…
Reference in New Issue
Block a user