Bläddra i källkod

Don't specify width in inline images

They don't necessarily need to be square, so only specify height
and let clients make the width fit automatically.
Tulir Asokan 2 år sedan
förälder
incheckning
694733a4e9
2 ändrade filer med 3 tillägg och 3 borttagningar
  1. 1 1
      commands.go
  2. 2 2
      portal.go

+ 1 - 1
commands.go

@@ -353,7 +353,7 @@ func fnListGuilds(ce *WrappedCommandEvent) {
 		}
 		var avatarHTML string
 		if !guild.AvatarURL.IsEmpty() {
-			avatarHTML = fmt.Sprintf(`<img data-mx-emoticon height="24" width="24" src="%s" alt="" title="Guild avatar"> `, guild.AvatarURL.String())
+			avatarHTML = fmt.Sprintf(`<img data-mx-emoticon height="24" src="%s" alt="" title="Guild avatar"> `, guild.AvatarURL.String())
 		}
 		items = append(items, fmt.Sprintf("<li>%s%s (<code>%s</code>) - %s</li>", avatarHTML, html.EscapeString(guild.Name), guild.ID, status))
 	}

+ 2 - 2
portal.go

@@ -740,7 +740,7 @@ func (portal *Portal) handleDiscordVideoEmbed(intent *appservice.IntentAPI, embe
 const (
 	embedHTMLWrapper         = `<blockquote class="discord-embed">%s</blockquote>`
 	embedHTMLWrapperColor    = `<blockquote class="discord-embed" background-color="#%06X">%s</blockquote>`
-	embedHTMLAuthorWithImage = `<p class="discord-embed-author"><img data-mx-emoticon width="24" height="24" src="%s" title="Author icon" alt="">&nbsp;<span>%s</span></p>`
+	embedHTMLAuthorWithImage = `<p class="discord-embed-author"><img data-mx-emoticon height="24" src="%s" title="Author icon" alt="">&nbsp;<span>%s</span></p>`
 	embedHTMLAuthorPlain     = `<p class="discord-embed-author"><span>%s</span></p>`
 	embedHTMLAuthorLink      = `<a href="%s">%s</a>`
 	embedHTMLTitleWithLink   = `<p class="discord-embed-title"><a href="%s"><strong>%s</strong></a></p>`
@@ -751,7 +751,7 @@ const (
 	embedHTMLFields          = `<table class="discord-embed-fields"><tr>%s</tr><tr>%s</tr></table>`
 	embedHTMLLinearField     = `<p class="discord-embed-field" x-inline="%s"><strong>%s</strong><br><span>%s</span></p>`
 	embedHTMLImage           = `<p class="discord-embed-image"><img src="%s" alt="" title="Embed image"></p>`
-	embedHTMLFooterWithImage = `<p class="discord-embed-footer"><sub><img data-mx-emoticon width="20" height="20" src="%s" title="Footer icon" alt="">&nbsp;<span>%s</span>%s</sub></p>`
+	embedHTMLFooterWithImage = `<p class="discord-embed-footer"><sub><img data-mx-emoticon height="20" src="%s" title="Footer icon" alt="">&nbsp;<span>%s</span>%s</sub></p>`
 	embedHTMLFooterPlain     = `<p class="discord-embed-footer"><sub><span>%s</span>%s</sub></p>`
 	embedHTMLFooterOnlyDate  = `<p class="discord-embed-footer"><sub>%s</sub></p>`
 	embedHTMLDate            = `<time datetime="%s">%s</time>`