PDA

View Full Version : Font tags in chat log exports have extra # in color attribute



slitherrr
January 18th, 2022, 00:13
Tried to search for this and didn't see it, it's a simple bug that doesn't affect much (and I wouldn't have even noticed if it weren't for it breaking an automated parser I wrote), but the generated log exports are sticking an extra hash (that is, U+0023 NUMBER SIGN, "#") at the beginning of the RGB sequence in the "color" attribute. For example:


<font color="##261A12">Urist: ... Huh.</font><br>

As per the spec (https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#colours), this is an error, although it seems to render fine and be of little material consequence except, as mentioned, breaking my automated parser.

mattekure
January 18th, 2022, 16:38
Tried to search for this and didn't see it, it's a simple bug that doesn't affect much (and I wouldn't have even noticed if it weren't for it breaking an automated parser I wrote), but the generated log exports are sticking an extra hash (that is, U+0023 NUMBER SIGN, "#") at the beginning of the RGB sequence in the "color" attribute. For example:


<font color="##261A12">Urist: ... Huh.</font><br>

As per the spec (https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#colours), this is an error, although it seems to render fine and be of little material consequence except, as mentioned, breaking my automated parser.

I am guessing this is because internally FG fonts have an alpha tag before the RGB numbers. they look like color="AARRGGBB" and the export is just reflecting that.

slitherrr
January 18th, 2022, 17:46
I am guessing this is because internally FG fonts have an alpha tag before the RGB numbers. they look like color="AARRGGBB" and the export is just reflecting that.

Interesting theory, although it would be strange in context since it used to export as #RRGGBB (which is the correct HTML syntax). I would personally just suspect a typo.

Moon Wizard
January 18th, 2022, 18:42
It looks like it has been that way in FGU since before the official release. I'll push a fix in the next release to remove the extra number sign.

Regards,
JPG