webfashionist/RichText

Adding html tags if editor is empty

Phantomrider opened this issue · 1 comments

When you submit a form with empty editor it adds <div><br></div> to the POST, which is a bummer, since you can't check very efficiently if it's really empty.

The reason for the <div><br></div> tags is in fact a bug fix for the case, that no container is created for the first paragraph.
So it won't be possible to remove it.

To check if the content is empty, you might want to strip all the HTML tags and check if the string is empty after doing so.