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.36k stars 4.05k forks source link

BUG: Whitespace handling in inline elements #5724

Closed bernesto closed 1 month ago

bernesto commented 7 months ago

GrapesJS version

What browser are you using?

Chrome v122

Reproducible demo link

https://jsfiddle.net/zwo0mdqf/5/

Describe the bug

How to reproduce the bug?

  1. Create valid inline block elements such as span, b, i, em, etc. that use multiple space, tab(s), or line breaks as word separators.

What is the expected behavior? These elements when rendered should be spaced apart by one space. HTML export whitespace should respect input whitespace.

What is the current behavior? These elements are rendered in the editor as separate components, but appear as one word. Output html is stripped of input whitespace. Note: Component HTML is exported on new lines per element, so displayed output does render correctly, but getHtml() does not.

Code of Conduct

danstarns commented 1 month ago

Closing in favor of merged commit. https://github.com/GrapesJS/grapesjs/pull/5719