e2email-org / e2email

E2EMail is a simple Chrome application - a Gmail client that exchanges OpenPGP mail.
Apache License 2.0
806 stars 62 forks source link

UI | Rendering HTML inside textarea #13

Closed KamilaHasanbega closed 8 years ago

KamilaHasanbega commented 8 years ago

I need to render html inside textarea, in order to have the divs for the names of the attachments, but that's not possible as textarea interprets everything as text (I want to have the UI similar to Gmail web). So what I've tried so far is:

Using a <div> with the contenteditable="true" property, instead of the <textarea> , problems with this are:

@kbsriram Please let me know if I have missed something or if there is any other way.

koto commented 8 years ago

You should not render HTML from the decrypted message. The text/plain MIME part should be rendered as-is in the textarea, attachment name & links should be bound to different HTML elements in the template (e.g. <div ng-repeat> - see https://docs.angularjs.org/api/ng/directive/ngRepeat)

Don't use <div contenteditable> for security reasons - decrypted text could contain XSS vectors, which would be activated if you put them inside the DOM.