e2email-org / e2email

E2EMail is a simple Chrome application - a Gmail client that exchanges OpenPGP mail.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UI | Rendering HTML inside textarea

KamilaHasanbega opened this issue · comments

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.

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.