mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-10 23:15:00 +08:00
fix(autoload-images): Watch for images declared in more attrs
Fixes #739
This commit is contained in:
parent
a52d0d415d
commit
c379353553
3 changed files with 8 additions and 2 deletions
|
@ -4,8 +4,12 @@ path = require 'path'
|
||||||
{Utils, MessageBodyProcessor} = require 'nylas-exports'
|
{Utils, MessageBodyProcessor} = require 'nylas-exports'
|
||||||
AutoloadImagesActions = require './autoload-images-actions'
|
AutoloadImagesActions = require './autoload-images-actions'
|
||||||
|
|
||||||
# https://en.wikipedia.org/wiki/Comparison_of_web_browsers#Image_format_support
|
# Match:
|
||||||
ImagesRegexp = /(src[\s]*=[\s]*['"]+|:[\s]*url\()+([^"'\)]*)/gi
|
# - 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
|
class AutoloadImagesStore extends NylasStore
|
||||||
constructor: ->
|
constructor: ->
|
||||||
|
|
1
internal_packages/message-autoload-images/spec/fixtures/table-body-in.html
vendored
Normal file
1
internal_packages/message-autoload-images/spec/fixtures/table-body-in.html
vendored
Normal 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;">
|
1
internal_packages/message-autoload-images/spec/fixtures/table-body-out.html
vendored
Normal file
1
internal_packages/message-autoload-images/spec/fixtures/table-body-out.html
vendored
Normal 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;">
|
Loading…
Reference in a new issue