SVG image as digest logo has limited support

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.’

2 Likes

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

Aha I remember asking @techapj about that…

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.

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

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

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

3 Likes

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.

3 Likes

Nice suggestion! Implemented via:

https://github.com/discourse/discourse/commit/f9d1a2554d180ac79000fe6263c7f57ea4f3f8ec

3 Likes

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

<tr>
  <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 %>
  </td>
</tr>
3 Likes

Created pull request for this issue:
https://github.com/discourse/discourse/pull/4135

4 Likes

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

2 Likes