Giter Site home page Giter Site logo

Comments (5)

Sicos1977 avatar Sicos1977 commented on June 12, 2024

This is normal HTML behavior, if you want to start on a new line you have to add the <br/> tag at the end.

line1<br/>
line2<br/>
line3<br/>

You can also use the <pre> tag, this preserves line feeds and enter at the end.

<pre>
line1
line2
line3
</pre>

from msgkit.

davidd4 avatar davidd4 commented on June 12, 2024

I can't agree. The whitespaces should not be removed from the text. They are characters too.

Please try it with your suggestion:

<pre>
line1
line2
line3
</pre>

image

and the result will be the same.

image

And it's wrong. The line breaks should be preserved, but they are removed in MsgKit code, in the method: Strings.GetEscapedRtf(BodyHtml);

Please check the attached .html file. My code is a valid html code, and it can be opened in any browser.
linebreaks.zip

from msgkit.

HarbinderGill avatar HarbinderGill commented on June 12, 2024

I should probably add, that we generate html from a docx, and then convert to html using the open xml power tools. If we take that markup and view in a browser, all line breaks are preserved. If we display in an email, some of the line breaks disappear. I've had to put in a couple of regex patterns to replace empty spans with
to get around it.

from msgkit.

Sicos1977 avatar Sicos1977 commented on June 12, 2024

Whatever I try I just can't get outlook to show the message with the line breaks (enters). I even fixed the GetEscapedRtf method and that still gives the same problem. So I think it is an limitation in Outlook and for that I'll close this issue and something that I can't fix. When I view the body in the outlook message the HTML is showed correctly but it still Isn't correct in Outlook

image

from msgkit.

Sicos1977 avatar Sicos1977 commented on June 12, 2024

When I make a new message in Outlook and view the body then you'll see that Outlook converts my 3 lines to HTML with paragraph (p) tags in it.

image

from msgkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.