fix(autoload-images): Watch for images declared in more attrs

Fixes #739
This commit is contained in:
Ben Gotow 2015-12-28 14:59:07 -08:00
parent a52d0d415d
commit c379353553
3 changed files with 8 additions and 2 deletions

View file

@ -4,8 +4,12 @@ path = require 'path'
{Utils, MessageBodyProcessor} = require 'nylas-exports'
AutoloadImagesActions = require './autoload-images-actions'
# https://en.wikipedia.org/wiki/Comparison_of_web_browsers#Image_format_support
ImagesRegexp = /(src[\s]*=[\s]*['"]+|:[\s]*url\()+([^"'\)]*)/gi
# Match:
# - any of the DOM attributes supporting images starting with a protocol
# (src, background, placeholder, icon, poster, or srcset)
# - any url() value
#
ImagesRegexp = /((?:src|background|placeholder|icon|background|poster|srcset)\s*=\s*['"]?(?=\w*:\/\/)|:\s*url\()+([^"'\)]*)/gi
class AutoloadImagesStore extends NylasStore
constructor: ->

View file

@ -0,0 +1 @@
<table width="598" class="deviceWidth" height="403" border="0" cellspacing="0" cellpadding="0" background="https://services.google.com/fh/files/emails/bkg_billboard_v2.png" bgcolor="#42a0fc" style="-webkit-text-size-adjust: none; border-collapse: collapse !important; mso-table-lspace: 0pt !important; mso-table-rspace: 0pt !important; border: 0px; display:block;width:598px; min-width:598px;">

View file

@ -0,0 +1 @@
<table width="598" class="deviceWidth" height="403" border="0" cellspacing="0" cellpadding="0" background="#" bgcolor="#42a0fc" style="-webkit-text-size-adjust: none; border-collapse: collapse !important; mso-table-lspace: 0pt !important; mso-table-rspace: 0pt !important; border: 0px; display:block;width:598px; min-width:598px;">