- {{~ # Author }}
- {{ if embed.Author }}
+ {{~ # Author ~}}
+ {{~ if embed.Author ~}}
- {{ if embed.Author.IconUrl }}
+ {{~ if embed.Author.IconUrl ~}}
- {{ end }}
+ {{~ end ~}}
- {{ if embed.Author.Name }}
+ {{~ if embed.Author.Name ~}}
- {{ if embed.Author.Url }}
- {{ embed.Author.Name | HtmlEncode }}
- {{ else }}
- {{ embed.Author.Name | HtmlEncode }}
- {{ end }}
+ {{~ if embed.Author.Url ~}}
+ {{ embed.Author.Name | html.escape }}
+ {{~ else ~}}
+ {{ embed.Author.Name | html.escape }}
+ {{~ end ~}}
- {{ end }}
+ {{~ end ~}}
- {{ end }}
+ {{~ end ~}}
- {{~ # Title }}
- {{ if embed.Title }}
+ {{~ # Title ~}}
+ {{~ if embed.Title ~}}
- {{ if embed.Url }}
+ {{~ if embed.Url ~}}
{{ embed.Title | FormatContent }}
- {{ else }}
+ {{~ else ~}}
{{ embed.Title | FormatContent }}
- {{ end }}
+ {{~ end ~}}
- {{ end }}
+ {{~ end ~}}
- {{~ # Description }}
- {{ if embed.Description }}
+ {{~ # Description ~}}
+ {{~ if embed.Description ~}}
{{ embed.Description | FormatContent true }}
- {{ end }}
-
- {{~ # Fields }}
-
- {{ for field in embed.Fields }}
-
- {{ if field.Name }}
-
{{ field.Name | FormatContent }}
- {{ end }}
- {{ if field.Value }}
-
{{ field.Value | FormatContent true }}
- {{ end }}
-
- {{ end }}
-
+ {{~ end ~}}
+
+ {{~ # Fields ~}}
+ {{~ if embed.Fields | array.size > 0 ~}}
+
+ {{~ for field in embed.Fields ~}}
+
+ {{~ if field.Name ~}}
+
{{ field.Name | FormatContent }}
+ {{~ end ~}}
+ {{~ if field.Value ~}}
+
{{ field.Value | FormatContent true }}
+ {{~ end ~}}
+
+ {{~ end ~}}
+
+ {{~ end ~}}
- {{~ # Thumbnail }}
- {{ if embed.Thumbnail }}
+ {{~ # Thumbnail ~}}
+ {{~ if embed.Thumbnail ~}}
- {{ end }}
+ {{~ end ~}}