mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 17:34:02 +08:00
FIX: Don't use auto sizes for very small images (emoticons)
This commit is contained in:
parent
8199c3b440
commit
5defaca197
|
@ -15,7 +15,6 @@ module Email
|
||||||
end
|
end
|
||||||
|
|
||||||
def html
|
def html
|
||||||
|
|
||||||
if @message.html_part
|
if @message.html_part
|
||||||
style = Email::Styles.new(@message.html_part.body.to_s)
|
style = Email::Styles.new(@message.html_part.body.to_s)
|
||||||
style.format_basic
|
style.format_basic
|
||||||
|
|
|
@ -37,8 +37,8 @@ module Email
|
||||||
img['height'] = 20
|
img['height'] = 20
|
||||||
else
|
else
|
||||||
# having no extra style on email images might work best?
|
# having no extra style on email images might work best?
|
||||||
img['width'] = 'auto'
|
img['width'] = 'auto' if img['width'].to_i > 20
|
||||||
img['height'] = 'auto'
|
img['height'] = 'auto' if img['height'].to_i > 20
|
||||||
add_styles(img, 'max-width:100%;') if img['style'] !~ /max-width/
|
add_styles(img, 'max-width:100%;') if img['style'] !~ /max-width/
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user