Skip to content

Commit

Permalink
Merge pull request #119 from lyle/showoff
Browse files Browse the repository at this point in the history
---

I changed the gsub statement for src="... to not modify the image src path if the existing path starts with a forward slash, denoting a root image reference.
  • Loading branch information
schacon committed Sep 10, 2011
2 parents 0c923e5 + 38e36af commit 2378db6
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 @@ -193,7 +193,7 @@ def update_image_paths(path, slide, static=false, pdf=false)
replacement_prefix = static ?
( pdf ? %(img src="file://#{options.pres_dir}/#{path}) : %(img src="./file/#{path}) ) :
%(img src="/image/#{path})
slide.gsub(/img src=\"(.*?)\"/) do |s|
slide.gsub(/img src=\"([^\/].*?)\"/) 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 2378db6

Please sign in to comment.