Fixes #2701 - Can't forward articles containing a <img> tag without src attribute.
This commit is contained in:
parent
1afa52f5f7
commit
adf4442648
2 changed files with 13 additions and 3 deletions
|
@ -1205,7 +1205,10 @@ class App.Utils
|
|||
|
||||
html.find('img').each( (index) ->
|
||||
src = $(@).attr('src')
|
||||
if !src.match(/^(data|cid):/i) # <img src="cid: ..."> may mean broken emails (see issue #2305)
|
||||
|
||||
# <img src="cid: ..."> or an empty src attribute may mean broken emails (see issue #2305 / #2701)
|
||||
return if !src? or src.match(/^(data|cid):/i)
|
||||
|
||||
base64 = App.Utils._htmlImage2DataUrl(@)
|
||||
$(@).attr('src', base64)
|
||||
)
|
||||
|
|
|
@ -3167,11 +3167,18 @@ test("htmlImage2DataUrl", function() {
|
|||
result = App.Utils.htmlImage2DataUrl(source)
|
||||
equal(result, should, source)
|
||||
|
||||
// GitHub issue #2305
|
||||
source = '<img src="cid:1234">some test'
|
||||
should = '<img src="cid:1234">some test'
|
||||
result = App.Utils.htmlImage2DataUrl(source)
|
||||
equal(result, should, source)
|
||||
|
||||
// GitHub issue #2701
|
||||
source = '<img alt="foo">some test'
|
||||
should = '<img alt="foo">some test'
|
||||
result = App.Utils.htmlImage2DataUrl(source)
|
||||
equal(result, should, source)
|
||||
|
||||
});
|
||||
|
||||
test('App.Utils.icon()', function() {
|
||||
|
|
Loading…
Reference in a new issue