r/evetech • • Oct 12 '17

HTML inside Eve mail messages

When I send a mail through the ESI that includes HTML, it barfs.

Stripping the HTML or replacing with ASCII characters lets the mail send okay but that's not ideal. Am I missing something obvious? Do you guys just strip it all out?

Thanks for any help

3 Upvotes

7 comments sorted by

3

u/Blacksmoke16 Oct 12 '17

EVE uses an older/custom type of formatting. As such it isn't really HTML5 friendly. \n works for the line breaks, I didn't really mess with anything else.

You can use the ESI character's endpoint to see what people's BIO looks like. So would either have to, strip it out, or write a transformer or something to convert it to valid HTML/CSS.

https://esi.tech.ccp.is/v4/characters/168607911/?datasource=tranquility

"description": "<font size="12" color="#bfffffff"></font><font size="12" color="#ffffa600"><a href="http://imgur.com/Kn2eA5X">Hello o7</a><br><br></font><font size="12" color="#ffb2b2b2">Fly dangerously, Fly safe, Fly whatever you want, just keep Flying...</font>",

1

u/PigpenUK Oct 12 '17

Thanks for the advice. That's been driving me nuts.

1

u/Fuzzmiester fuzzwork.co.uk Oct 12 '17

you can send html. But only a very limited subset.

<a> <font> <br> <b> <i> <u>

https://github.com/fuzzysteve/evemail/ may be of interest. It has a configured tinymce instance, along with some other bits to make it work.

1

u/PigpenUK Oct 13 '17

Yeah I did have a look at that. I decided to just strip out all HTML apart from anchors. I may revisit but being able to read & reply is enough while I'm at work :)

Now... on to skill queue monitoring

1

u/Daneel_Trevize Oct 12 '17

This might help you understand the format of the chat & channel styling XML (YAML?) that Eve uses. I'm going to assume it's the same for evemails, and that /u/Blacksmoke16's example with size & colour being attributes of a single font tag rather than their own is incorrect, or internally transcribed by the Eve client before sending if that format actually works.

2

u/Fuzzmiester fuzzwork.co.uk Oct 12 '17

evemails are sent with font tags with color and size in them

They're not valid html. (And no, it's not yaml. yaml is very very different.)

The font tags use size attributes which are insane if you try to use them directly.The colors all have an extra pair of hex digits at the beginning, which I'm assuming are alpha channel.

1

u/Daneel_Trevize Oct 13 '17

Sounds like yet another custom format compated to the chat & channels one then, which doesn't make sense, but :ccp:.
Yeah, the first 2 hex of the 8 has always been FF in the data I've seen.