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

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

Instance Method Summary collapse

Instance Method Details

#replace_absolute(link) ⇒ Object



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

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

#rewrite_uploads(link) ⇒ Object



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

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