ContentTools
ContentTools copied to clipboard
How to enter and save an empty line or paragraph
I cannot seem to save an (almost) empty line or paragraph to a document
<p> </p>
would be removed on save
<p> </p>
would be removed on save
<p>The actual text.<br> </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.
Hi @cyclaero - So CT by default wont hold on to empty paragraphs it strips them. But there are possible workarounds.
- Set the
ContentEdit.TRIM_WHITESPACE
flag to false, this should allow your paragraphs to contain a simple
or a no width space​
- There's a more complete workaround documented here that you might consider: https://github.com/GetmeUK/ContentTools/issues/298
Setting ContentEdit.TRIM_WHITESPACE
to false
serves for my present needs, since with this in place, upon save of <p>The actual text.<br> </p>
the line break and
or ​
are not removed.
<p> </p>
still doesn't work, though.
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