Le mercredi 6 juillet 2016 04:02:24 UTC+2, Neil Jenkins a écrit : > > On Wed, 6 Jul 2016, at 01:14 AM, Raphaël Ouazana wrote: > > What is the point of converting textBody into htmlBody? > > > The idea was this: for simplicity, clients may only want to have to deal > with rendering HTML rather than having a separate code path for rendering > plain text (which will need to mark up URLs etc.). Similarly, basic clients > may always want just to handle a plain text version. > > (Requesting just "body" will return the htmlBody if the message has an > HTML part, otherwise the textBody, which is probably what you want for most > rich clients.) > > Certainly I think we need the ability for clients to be able to always > request a plain text version, for those that cannot safely handle HTML > (older browser support, lower power devices). The ability to always request > an HTML version is arguably less useful, although is consistent. > > If we dropped the generation of an HTML version we could make it: > > - *textBody*: String The plain text body part for the message. If there > is only an HTML version of the body, a plain text version MUST be generated > from this. > - *htmlBody*: String|null The HTML body part for the message if present. >
Thank you for your answer. This modification seems perfect to me. > Perhaps a better alternative (and more consistent) is to make the standard > "textBody"/"htmlBody" properties be only if present, but add special > properties "generate-htmlBody"/"generate-textBody" you could request that > would then generate a "textBody"/"htmlBody" if not present. (This is a bit > like the special "body" property you can request; it's not actually a > property that's returned, but it affects what is returned for > textBody/htmlBody). Thoughts? > This could be a good alternative too, allowing to keep original content clearly separated from computed content and allowing clients to choose which version they want. An other alternative would be to ask for some special properties "generated-htmlBody" and "generated-textBody", but it is a little less consistent with for example "body" specification. Regards, Raphaël Ouazana. -- You received this message because you are subscribed to the Google Groups "JMAP" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jmap-discuss/b51b25da-51c3-461e-a9f3-22325f222dfa%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
