GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.4k stars 4.06k forks source link

BUG: Text element does not work properly #4173

Closed Ameeko closed 2 years ago

Ameeko commented 2 years ago

GrapesJS version

What browser are you using?

Chrome v98

Reproducible demo link

https://grapesjs.com/demo.html

Describe the bug

I opened a notepad (Win11) I wrote this in the notepad: test [enter] test [enter] test [enter] I selected the entire text and copied it to the clipboard I created a "Text" element in the GrapesJS editor I copied the text from the clipboard into the "Text" element I clicked outside This will be the result image

If I enter this text into a "Text" element manually test [enter] test [enter] test [enter] and click outside, the text will be placed in 1 "Text" element. This is good. Unfortunately, people usually paste the text.

Code of Conduct

artf commented 2 years ago

This is not directly related to GrapesJS, this all depends on how the pasted content is stored from the external application and which tags are used for the new lines.

Ameeko commented 2 years ago

The text was a plain text, it had no tags. I tested with \n and \r\n line breaks, it doesn't work well. Unnecessary tags appear in GrapesJS when inserting plain text with line breaks.

Ameeko commented 2 years ago

Can anyone help me with this?

Joshmamroud commented 2 years ago

@Ameeko & @artf I'm also having this issue. Has anyone found a fix for this?