SVG image as digest logo has limited support

(Simon Cossar) #1

SVG images are not rendered in Gmail or Outlook 2013 email clients. For this reason they are not a good choice for the digest logo. Should this be mentioned in the description under the ‘digest logo url’ setting? Something like ‘SVG images have limited support across email clients.’

(Jeff Atwood) #2

Possibly but svg logos would be quite rare and this feels a bit like trivia.

(Simon Cossar) #3

(Jeff Atwood) #4

Aha I remember asking @techapj about that…

(Simon Cossar) #5

It’s unrelated, but also the ‘box’ category style doesn’t work in gmail. The category is there, but it’s white writing on a white background.

(Jeff Atwood) #6

I also asked @techapj about that as well. We should fix the white on white badges if we can.

(Sam Saffron) #7

I would not bother mentioning, just add a regex test that disallows .svg from the site setting

(Simon Cossar) #8

It will still be a problem when sites are using their default logo:

(Simon Cossar) #9

The Docker forum has the same issue. There could be a test for SVG logos in digest.html.erb in the same place where you are testing if the logo is blank. If it is an SVG, display SiteSettings.title instead of a broken link.

(Arpit Jalan) #10

Nice suggestion! Implemented via:

(Simon Cossar) #11

It looks like the anchor element isn’t being closed when the logo is blank.

  <td style="padding: 10px 10px; background-color: #<%= @header_color %>;">
    <a href="<%= Discourse.base_url %>" style='color: #<%= @anchor_color %>'>
    <%- if logo_url.blank? %>
      <%= SiteSetting.title %>
    <%- else %>
      <img src="<%= logo_url %>" style="max-height: 35px; min-height: 35px; height: 35px;" class='site-logo'></a>
    <%- end %>

(Dean Taylor) #12

Created pull request for this issue:

(Kane York) #13

That one would probably do better as a SiteSettingValidation. Prevent you from setting a .svg logo in the first place.