Skip to content

Commit

Permalink
Add support external image sources. Fixes binford2k#91.
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalossilva committed Mar 5, 2012
1 parent 91d4278 commit 88490cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/showoff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def update_image_paths(path, slide, static=false, pdf=false)
replacement_prefix = static ?
( pdf ? %(img src="file://#{settings.pres_dir}/#{path}) : %(img src="./file/#{path}) ) :
%(img src="#{@asset_path}image/#{path})
slide.gsub(/img src=[\"\']([^\/].*?)[\"\']/) do |s|
slide.gsub(/img src=[\"\'](?!https?:\/\/)([^\/].*?)[\"\']/) do |s|
img_path = File.join(path, $1)
w, h = get_image_size(img_path)
src = %(#{replacement_prefix}/#{$1}")
Expand Down

0 comments on commit 88490cd

Please sign in to comment.