Skip to content

Instantly share code, notes, and snippets.

@pieter
Created July 31, 2008 01:07
Show Gist options
  • Save pieter/3369 to your computer and use it in GitHub Desktop.
Save pieter/3369 to your computer and use it in GitHub Desktop.
From 7d1e8ed8677f2db5aaf6972b304c93fb87dad3de Mon Sep 17 00:00:00 2001
From: Pieter de Bie <pdebie@ai.rug.nl>
Date: Thu, 31 Jul 2008 03:01:37 +0200
Subject: [PATCH] Simplify image processing code
---
script/html.rb | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/script/html.rb b/script/html.rb
index 7475bdd..8b2b327 100644
--- a/script/html.rb
+++ b/script/html.rb
@@ -31,12 +31,8 @@ def do_replacements(html, type = :html)
end
# fix images in pdf
- if type == :pdf
- html = html.gsub /src="images/ do |img|
- 'src="assets/images'
- end
- end
-
+ html.gsub!('src="images', 'src="assets/images') if type == :pdf
+
# replace/remove gitcasts
html = html.gsub /\[gitcast:.*?\]\(.*?\)/ do |code|
--
1.6.0.rc1.163.gc85c5.dirty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment