Module: Spix::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/spix_parser/parser.rb

Instance Method Summary collapse

Instance Method Details



34
35
36
37
38
39
40
41
42
# File 'lib/spix_parser/parser.rb', line 34

def format_links(options)
  text     = options[:text]
  site_url = options[:site_url]

  parse_links(text, site_url)
  parse_images(text, site_url)

  text
end

#publisher_special_case(options) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/spix_parser/parser.rb', line 44

def publisher_special_case(options)
  text = options[:text] 
  url = options[:url]
  begin
    case publisher = URI.parse(url).host
    when /ig\.com/
      strip_tags(text, 'span', :class => 'inclusion')  
    else
      text
    end
  rescue
    text
  end
end