Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi line codes in <pre> turn to one line after mail send. #692

Closed
lengerrong opened this issue Jun 14, 2018 · 5 comments
Closed

multi line codes in <pre> turn to one line after mail send. #692

lengerrong opened this issue Jun 14, 2018 · 5 comments
Labels
difficulty: medium fix is medium in difficulty status: work in progress Twilio or the community is in the process of implementing type: community enhancement feature request not on Twilio's roadmap

Comments

@lengerrong
Copy link

lengerrong commented Jun 14, 2018

Issue Summary

I use mail to write my blog.
with markdown syntax.

int a = 10;
int b = 10;
int c = 10;

it will generate below html code:

int a = 10;
int b = 10;
int de = 10;

then I send this html code to my blogger.
but in the post of my blog, the html change

int a = 10; int b = 10; int de = 10;

All codes are in one line, which is not my want.

Would you help me to work around for it please ?

Steps to Reproduce

      sgMail.setApiKey(process.env.SENDGRID_API_KEY);
      let msg = {
        to: 'errong.leng@blogger.com',
        from: 'errong.leng@gmail.com',
        subject: title,
        html: html,
      };
     sgMail.send(msg);

I confirm that html is correct and the codes are multi lines.
console.log(html)'s output is

int a = 10;
int b = 10;
int de = 10;

I wish I can get multi lines code in my post also.
but in fact, all codes are placed in one line in my post.

int a = 10; int b = 10; int de = 10;

What should I do with html here ?

Technical details:

  • sendgrid-nodejs Version: master (latest commit: [commit number])
  • Node.js Version: 4.1.2
@lengerrong
Copy link
Author

html is

<pre><code>int a = 10; 
int b = 10; 
int c = 10; 
int d = 10; </code></pre>

then send to blog.
in my blog post, it comes to

<pre><code>int a = 10; int b = 10; int c = 10; int d = 10; </code></pre>

@thinkingserious
Copy link
Contributor

Hello @lengerrong,

Have you tried adding <br/> tags at the end of each line?

@thinkingserious thinkingserious added type: question question directed at the library status: help wanted requesting help from the community difficulty: unknown or n/a fix is unknown in difficulty labels Jun 25, 2018
@ssiddhantsharma
Copy link
Contributor

@thinkingserious Hey, it feels great to be back and contributing again. Let me take this.

ssiddhantsharma added a commit to ssiddhantsharma/sendgrid-nodejs that referenced this issue Oct 3, 2018
ssiddhantsharma added a commit to ssiddhantsharma/sendgrid-nodejs that referenced this issue Oct 3, 2018
@thinkingserious thinkingserious added type: community enhancement feature request not on Twilio's roadmap status: work in progress Twilio or the community is in the process of implementing difficulty: medium fix is medium in difficulty and removed difficulty: unknown or n/a fix is unknown in difficulty status: help wanted requesting help from the community type: question question directed at the library labels Oct 5, 2018
@thinkingserious
Copy link
Contributor

Thank you @ssiddhantsharma, it's great to have you back!

ssiddhantsharma added a commit to ssiddhantsharma/sendgrid-nodejs that referenced this issue Oct 7, 2018
Added the sendgrid#692 multi line codes in <pre> turn to one line after mail send,
to the troubleshooting.md on your request.

Co-Authored-By: Elmer Thomas <elmer@thinkingserious.com>
@thinkingserious
Copy link
Contributor

Since there has been no activity on this issue since March 1, 2020, we are closing this issue. Please feel free to reopen or create a new issue if you still require assistance. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty status: work in progress Twilio or the community is in the process of implementing type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants