Module: Snatch::Clean::HTML::SrcFixMethods

Defined in:
lib/snatch/clean/html.rb

Instance Method Summary collapse

Instance Method Details

#replace_absolute(link) ⇒ Object



37
38
39
# File 'lib/snatch/clean/html.rb', line 37

def replace_absolute(link)
  link['src'] = link['src'].sub(%r{^(https?)://#{MARKETING_SITE}/}, '/')
end

#rewrite_uploads(link) ⇒ Object



41
42
43
# File 'lib/snatch/clean/html.rb', line 41

def rewrite_uploads(link)
  link['src'] = link['src'].sub(%r{^#{UPLOADS_DIR}/}, "/#{UPLOADS_DIR}/")
end