Method: Convert.run

Defined in:
lib/convert.rb

.run(string, options = {}) ⇒ Object

Run all the converters or the ones you sent to the initializers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/convert.rb', line 39

def self.run(string, options = {})
  return '' if !string

  # Setup
  options = {:markdown => true, :config => :custom, :converters => DEFAULT}.merge(options)

  # Include
  options[:converters] += options[:include] if options[:include]

  # Exclude
  options[:converters] -= options[:exclude] if options[:exclude]

  # Markdown
  string = markdown(string, :autolink => false) if options[:markdown]

  # Scan
  string = scan(string, options)

  # Sanitize
  string = sanitize(string, :config => options[:config])

  string
end