Skip to content

Instantly share code, notes, and snippets.

@mrkurt
Created March 5, 2009 04:06
Show Gist options
  • Save mrkurt/74186 to your computer and use it in GitHub Desktop.
Save mrkurt/74186 to your computer and use it in GitHub Desktop.
munch do |h|
(h / 'div.img').each do |img|
src = (img % 'img').attributes['src']
(img / 'img').remove
text = img.inner_html
img.swap("<div class=\"ImageRight\"><div><img src=\"#{src}\" /></div><div>#{text}</div></div>")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment