New editor - text blocks use DIV instead of P and strip out non-breaking space character when exporting

Badge +2


Trying to create some email templates - when I use a text block and type normal text it wraps it in <div> tags instead of <p> which the old editor used.

This is good for Outlook emails, since adding a linebreak between “paragraphs” adds a

<div> </div>

which Outlook seems to honour and saves having to do the old manual trick of adding

<!--[if mso]><br><![endif]-->

after each <p> tag within a block.

Some of these templates we need to send from our internal system - but when I export the HTML it is removing the non-breaking space (&nbsp;) from between the <divs> - this means all paragraphs are squished together.

eg: In a text block I type:
Some words

Another paragraph

Viewing the code it is:

<div>Some words.</div>
<div>Another paragraph</div>

But when I export, it becomes:

<div>Some words.</div>
<div> </div>
<div>Another paragraph</div>

Can you please advise how to export so it doesn’t remove the &nbsp; code.

Or alternatively, why the text block is using <div> instead of <p> tags?  


And is there any way to make the context editor wider? It is difficult to work on long text in that small window area.




Best answer by MarkG 26 May 2023, 04:36

View original

5 replies

Badge +2

I tried changing all the <div>&nbsp;</div> to <br /> instead, but the editor just changes them back to <div>&nbsp;</div>.

Through trial an error I’ve discovered if you wrap the entired text block in another <div> and replace all the <div>&nbsp;</div> with <br /> the exporter leaves it alone.


<div>Some words</div>
<br />
<div>more words</div>

But this is all very manual and tedious.​​​​​​   

Hopefully I’m missing something obvious, or Klaviyo can fix this behaviour.

Userlevel 7
Badge +60

Hi there @MarkG


Thanks for sharing your question with us! 


This is definitely not expected behavior. I am going to share this with our engineers and will get back to you when we have more insight.


Thanks for participating in the Community!


Badge +2

Thanks @Taylor Tarpley ,

We’ve also discovered that the exporter turns entities such as &reg; into encoded ®, which is creating alot of re-work for us.


@Taylor Tarpley updates on the fact that when I paste text, it goes in <div> instead of <p>?

Userlevel 3
Badge +5

+1 for this.


Even if I paste HTML the editor converts P tags to DIVs upon switching from code edit.