Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

RTF Mails are rendered differently #651

Copy link
Copy link

Description

@Faelean
Issue body actions

I think I've figured out what is happening so this is more of a "is there a workaround" issue.

One of our use cases is converting an email to HTML (via the getHTMLText function on the Email class) and display it in a browser. With the latest update of rtf-to-html the HTML is now wrapped with a <pre style="white-space:pre-wrap">. While this does preserve line breaks, it also adds the default browser styles for pre tags:

     display: block;
     font-family: monospace;
     white-space: pre;
     margin: 1em 0;

Especially the font-family: monospace; completely changes how the mail is displayed since it overrides the font from the one we provide with whatever monospace font is available on the system.
I also can't just add a style for the pre tag since (as far I've seen) when using the getHTMLText function I have no way of knowing if the original mail is an RTF or a HTML mail. Adding this style would possibly change the font of a pre tag inside an HTML mail, where a monospace font is wanted. My current idea is looking for <pre style="white-space:pre-wrap"> and replace it with a span. Do you have any input on how to make this work?

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.