i am currently *properly* looking into how discord url embeds work and trying to simulate their behavior. in the process i've already found multiple quirks:

- the title is truncated at 67 characters (70-3). when it's anywhere above that number, only the first 67 characters are used, and "..." is appended to the string. (yes, if you have a 68 character string, it will just remove the last letter and add the ellipsis...). the description is truncated the same way but with 347 characters. you'd assume the same thing happens to the "provider"/"og:site_name" field, and sure enough it caps out at 253 characters... except if you go any higher, the embed will just not show up at all. i can only assume that there's some bug on discord's side

- ...did i say characters? i meant *the raw length of the bytes sequence*. that's right, a single utf-8 character like "·" counts as 2 "characters". i assume they just load up the site content as raw bytes rather than an utf-8 string (probably just so that they don't have to guess the encoding??? need to verify if it works with non-utf8 encodings)

- the "theme-color" meta tag content is applied to the left border of the embed. the handling of the value is completely bonkers though: it only accepts hex strings (even though the spec allows for any valid css color value), and if you provide a hex string with a length of less than 6, it gets zero-padded. that's right, if you do #abc, instead of getting #aabbcc, you get #000abc! even better, it works with any less than 6 digits, so #1 becomes #000001. (just # makes the color not work, though.)

- also related to the theme color, they convert it down to hsl in the client anyways, and they round the hue and lightness values, so in many cases you get a slightly different color back than what you put in