Class: Convert
Overview
# # # # # The Convert module is responsible for converting strings
Constant Summary collapse
- CONVERTERS =
Some of the matchers are taken from github.com/dejan/auto_html
[:iframe_embed, :dailymotion, :email_escape, :flickr, :gist, :google_maps, :hashtag, :html_escape, :image_tag, :instagram, :liveleak, :markdown, :metacafe, :redcarpet, :soundcloud, :ted, :twitter, :video_embed, :vimeo, :vimeo_embed, :worldstar, :youtube, :youtube_embed, :youtube_js_api, :auto_link, :encode, :decode, :strip_params, :sanitize, :nokogiri]
- DEFAULT =
[:dailymotion, :flickr, :gist, :google_maps, :instagram, :liveleak, :metacafe, :soundcloud, :ted, :twitter, :vimeo, :worldstar, :youtube, :auto_link]
Class Method Summary collapse
-
.run(string, options = {}) ⇒ Object
Run all the converters or the ones you sent to the initializers.
Class Method Details
.run(string, options = {}) ⇒ Object
Run all the converters or the ones you sent to the initializers
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/convert.rb', line 40 def self.run(string, = {}) return '' if !string # Setup = {:markdown => true, :config => :custom, :converters => DEFAULT}.merge() # Include [:converters] += [:include] if [:include] # Exclude [:converters] -= [:exclude] if [:exclude] # Markdown string = markdown(string, :autolink => false) if [:markdown] # Scan string = scan(string, ) # Sanitize string = sanitize(string, :config => [:config]) string end |