lib/converters/email_escape.rb
# Remove stuff from email body that is going to be stripped anyway.
Remove stuff from email body that is going to be stripped anyway.
Remove stuff from email body that is going to be stripped anyway .
def email_escape(string, options = {})
      options = {}.merge(options)
      @regex = /<iframe.+src=['"].+\/embed\/(.+)[?].+['"].+iframe>/
      string = string.gsub(@regex, "https://youtu.be/#{'\1'}")
      @regex = /<iframe.+src=['"]\/\/player\.vimeo.com\/video\/(.+)[?]{1}.+['"].+iframe>/
      string = string.gsub(@regex, "https://vimeo.com/#{'\1'}")
      string
    end
def email_escape ( string , options = { } ) options = { } . merge ( options ) @regex = / <iframe.+src=['"].+ \/ embed \/ (.+)[?].+['"].+iframe> / string = string . gsub ( @regex , "https://youtu.be/#{'\1'}" ) @regex = / <iframe.+src=['"] \/ \/ player \. vimeo.com \/ video \/ (.+)[?]{1}.+['"].+iframe> / string = string . gsub ( @regex , "https://vimeo.com/#{'\1'}" ) string end
Remove stuff from email body that is going to be stripped anyway.
Remove stuff from email body that is going to be stripped anyway .
# No options at the moment # Youtube videos # Vimeo videos # Example: https://vimeo.com/59437462
string
options