module Convert
Convert
strings and HTML from a long list of converters @homepage: github.com/fugroup/convert @author: Vidar <vidar@fugroup.net>, Fugroup Ltd. @license: MIT, contributions are welcome.
Constants
- CONVERTERS
Some of the matchers are taken from github.com/dejan/auto_html
- DEFAULT
Public Class Methods
run(string, options = {})
click to toggle source
Run all the converters or the ones you sent to the initializers
# File lib/convert.rb, line 36 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