Multi lines in <pre></pre> become one line after send mail.

冷二荣 <[email protected]> Thu, 14 Jun 2018 23:33:15 -0700 (PDT)
Newsgroups gmane.comp.web.blogger.api
Message-ID <[email protected]>
------=_Part_6383_1980303508.1529044395311
Content-Type: multipart/alternative; 
	boundary="----=_Part_6384_1749528031.1529044395311"

------=_Part_6384_1749528031.1529044395311
Content-Type: text/plain; charset="UTF-8"

Dear blogger team,

I enable Posting using email on my blogger(https://lengerrong.blogspot.com)
And I use sendgrid API to send post to my blog via its node.js lib.

const sgMail = require('@sendgrid/mail');
console.log(process.env.
SENDGRID_API_KEY);
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
var html = '<pre><code>int a = 10;
int b = 10;
    int d = 10;
    int e = 10;
</code></pre>';
const msg = {
  to: '[email protected]',
  from: '[email protected]',
  subject: 'Test blogger markdown',
  text: 'Test blogger markdown with code',
  html: html,
};
sgMail.send(msg);

I wish codes display like 
int a = 10;\n
int b = 10;\n
\tint d = 10;
\tint e = 10;

but in face, the post in blogger display all codes just in one line.
int a = 10; int b = 10; int d = 10; int e = 10;

Does anyone knows what happened here ?
why the <pre><code> was not displayed as I wanted.

<div class="kg-card-markdown"><pre><code>int acadfasdf=
intsafasdf
dfsd 
    aldfjasdf
afja;sdfsaf
sdflksdfj;
;kafjksdfj;sdf
asdfdf;dfdf
     
     
     asdfjdslf
     
     
</code></pre>
</div>

I tried this html content.
          sgMail.setApiKey(process.env.SENDGRID_API_KEY);
          let msg = {
            to: ['[email protected]','[email protected]'],
            from: '[email protected]',
            subject: title,
            html: html,
          };
          sgMail.send(msg);

and send the html to two emails.
one is for blogger posting.
the other is my private email.
I found in my private email, the html displayed normal.

<https://lh3.googleusercontent.com/--xX9_Lc10Oo/WyI5AghCPrI/AAAAAAAABBk/VoOvBJTNuMkCpPg5A_V_i2clvh1wSMf7gCLcBGAs/s1600/Capture.PNG>

but only in blogger, the new post show all in one line.

<https://lh3.googleusercontent.com/-wpRtGGr77p8/WyI5VtWIlcI/AAAAAAAABBw/JsN2Mn8E_EEuuRQPCzX77dWft1CP3-lTwCLcBGAs/s1600/Capture2.PNG>

It seems like blogger posting email handle the html wrongly.

-- 
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" 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].
Visit this group at https://groups.google.com/group/bloggerdev.
For more options, visit https://groups.google.com/d/optout.

------=_Part_6384_1749528031.1529044395311
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Dear blogger team,<br><br><div>I <span>enable Posting usin=
g email on my blogger(<a href=3D"https://lengerrong.blogspot.com" target=3D=
"_blank" rel=3D"nofollow">https://lengerrong.<wbr>blogspot.com</a>)</span><=
/div><div><span>And I use sendgrid API to send post to my blog via its node=
.js lib.</span></div><div><span><br></span></div>const sgMail =3D require(&=
#39;@sendgrid/mail&#39;);<br>console.log(process.env.<div dir=3D"ltr"><wbr>=
SENDGRID_API_KEY);<br><div>sgMail.setApiKey(process.env.<wbr>SENDGRID_API_K=
EY);</div><div>var html =3D &#39;&lt;pre&gt;&lt;code&gt;int a =3D 10;<br>in=
t b =3D 10;<br>=C2=A0=C2=A0=C2=A0 int d =3D 10;<br>=C2=A0=C2=A0=C2=A0 int e=
 =3D 10;<br>&lt;/code&gt;&lt;/pre&gt;&#39;;</div>const msg =3D {<br>=C2=A0 =
to: &#39;<a href=3D"mailto:[email protected]" target=3D"_blank" rel=
=3D"nofollow">[email protected]</a>&#39;,<br>=C2=A0 from: &#39;<a hre=
f=3D"mailto:[email protected]" target=3D"_blank" rel=3D"nofollow">erron=
[email protected]</a>&#39;,<br>=C2=A0 subject: &#39;Test blogger markdown&#3=
9;,<br>=C2=A0 text: &#39;Test blogger markdown with code&#39;,<br>=C2=A0 ht=
ml: html,<br>};<br><div>sgMail.send(msg);</div><div><br></div><div>I wish c=
odes display like <br></div><div>int a =3D 10;\n</div><div>int b =3D 10;\n<=
br></div><div>\tint d =3D 10;</div><div>\tint e =3D 10;<br><br></div><div>b=
ut in face, the post in blogger display all codes just in one line.<br></di=
v><div>int a =3D 10; int b =3D 10; int d =3D 10; int e =3D 10;</div><div><b=
r></div><div>Does anyone knows what happened here ?</div><div>why the &lt;p=
re&gt;&lt;code&gt; was not displayed as I wanted.<br><br><div><div><div><di=
v><div><div><div>&lt;div class=3D&quot;kg-card-markdown&quot;&gt;&lt;pre&gt=
;<wbr>&lt;code&gt;int acadfasdf=3D<br>intsafasdf<br>dfsd <br>=C2=A0=C2=A0=
=C2=A0 aldfjasdf<br>afja;sdfsaf<br>sdflksdfj;<br>;kafjksdfj;sdf<br>asdfdf;d=
fdf<br>=C2=A0=C2=A0=C2=A0=C2=A0 <br>=C2=A0=C2=A0=C2=A0=C2=A0 <br>=C2=A0=C2=
=A0=C2=A0=C2=A0 asdfjdslf<br>=C2=A0=C2=A0=C2=A0=C2=A0 <br>=C2=A0=C2=A0=C2=
=A0=C2=A0 <br>&lt;/code&gt;&lt;/pre&gt;<br>&lt;/div&gt;<br><br></div>I trie=
d this html content.<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 sgMail.setApiKey(process.env.<wbr>SENDGRID_API_KEY);<br>=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 let msg =3D {<br>=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 to: [&#39;<a href=3D"mailt=
o:[email protected]" target=3D"_blank" rel=3D"nofollow">errong.leng@b=
logger.com</a>&#39;,&#39;<a href=3D"mailto:[email protected]" target=3D=
"_blank" rel=3D"nofollow">er<wbr>[email protected]</a>&#39;],<br>=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 from: &#39;<a =
href=3D"mailto:[email protected]" target=3D"_blank" rel=3D"nofollow">er=
[email protected]</a>&#39;,<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 subject: title,<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 html: html,<br>=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 };<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 sgMail.send(msg);<br><br></div>and send the html to t=
wo emails.<br></div>one is for blogger posting.<br></div>the other is my pr=
ivate email.<br></div>I found in my private email, the html displayed norma=
l.</div><p style=3D"text-align:center;clear:both"><a href=3D"https://lh3.go=
ogleusercontent.com/--xX9_Lc10Oo/WyI5AghCPrI/AAAAAAAABBk/VoOvBJTNuMkCpPg5A_=
V_i2clvh1wSMf7gCLcBGAs/s1600/Capture.PNG" style=3D"margin-left:1em;margin-r=
ight:1em" target=3D"_blank" rel=3D"nofollow"><img src=3D"https://lh3.google=
usercontent.com/--xX9_Lc10Oo/WyI5AghCPrI/AAAAAAAABBk/VoOvBJTNuMkCpPg5A_V_i2=
clvh1wSMf7gCLcBGAs/s320/Capture.PNG" width=3D"320" height=3D"141" border=3D=
"0"></a></p><div><br></div><div>but only in blogger, the new post show all =
in one line.</div><p style=3D"text-align:center;clear:both"><a href=3D"http=
s://lh3.googleusercontent.com/-wpRtGGr77p8/WyI5VtWIlcI/AAAAAAAABBw/JsN2Mn8E=
_EEuuRQPCzX77dWft1CP3-lTwCLcBGAs/s1600/Capture2.PNG" style=3D"margin-left:1=
em;margin-right:1em" target=3D"_blank" rel=3D"nofollow"><img src=3D"https:/=
/lh3.googleusercontent.com/-wpRtGGr77p8/WyI5VtWIlcI/AAAAAAAABBw/JsN2Mn8E_EE=
uuRQPCzX77dWft1CP3-lTwCLcBGAs/s320/Capture2.PNG" width=3D"320" height=3D"80=
" border=3D"0"></a></p><div><br></div>It seems like blogger posting email h=
andle the html wrongly.<br></div><div><br></div></div></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;Blogger Developer Group&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">bloggerd=
[email protected]</a>.<br />
To post to this group, send email to <a href=3D"mailto:bloggerdev@googlegro=
ups.com">[email protected]</a>.<br />
Visit this group at <a href=3D"https://groups.google.com/group/bloggerdev">=
https://groups.google.com/group/bloggerdev</a>.<br />
For more options, visit <a href=3D"https://groups.google.com/d/optout">http=
s://groups.google.com/d/optout</a>.<br />

------=_Part_6384_1749528031.1529044395311--

------=_Part_6383_1980303508.1529044395311--