ContentTools icon indicating copy to clipboard operation
ContentTools copied to clipboard

How to enter and save an empty line or paragraph

Open cyclaero opened this issue 6 years ago • 3 comments

I cannot seem to save an (almost) empty line or paragraph to a document <p>&nbsp;</p> would be removed on save <p>&#8194;</p> would be removed on save <p>The actual text.<br>&nbsp;</p> removes the line break and the space.

The only kind of working empty line which would not be removed on save that I found is: <p><span hidden>.</span>/p>

What is the supported way to add and save empty lines or paragraphs?

I am working with the lates ContentTools from the present GitHub repeository.

cyclaero avatar Jun 05 '18 23:06 cyclaero

Hi @cyclaero - So CT by default wont hold on to empty paragraphs it strips them. But there are possible workarounds.

  1. Set the ContentEdit.TRIM_WHITESPACE flag to false, this should allow your paragraphs to contain a simple &nbsp; or a no width space &#8203;
  2. There's a more complete workaround documented here that you might consider: https://github.com/GetmeUK/ContentTools/issues/298

anthonyjb avatar Jun 05 '18 23:06 anthonyjb

Setting ContentEdit.TRIM_WHITESPACE to false serves for my present needs, since with this in place, upon save of <p>The actual text.<br>&nbsp;</p> the line break and &nbsp; or &#8203; are not removed. <p>&nbsp;</p> still doesn't work, though.

cyclaero avatar Jun 06 '18 00:06 cyclaero

Some of my clients reported the problem to not be able to insert spaces between paragraphs like they want.

I can understand that contenttools would automatically remove empty paragraphs cause it's not semantically correct. But it should respect line break <br /> when customer do a shift + enter

ghost avatar Mar 01 '19 10:03 ghost