I am using the Editor WYSIWYG add-on so that I can have WYSIWYG support in the category description editor. This has been working fine until the following issue arose.
When the category description is left in a way that appears empty, it actually outputs the following <p><br></p>
which is bad for three reasons:
- It is not XHTML compliant (the
<br>
should be<br/>
). - There is no sense for there to be an
<br>
element in the first place... it should be blank. Sure I can understand the empty<p>
element but why the other? - The following template logic fails to work (primary concern):
{if category_description}
<div class="category-description">{category_description}</div>
{/if}
How can I prevent the Editor add-on from generating junk for when an empty description is specified? or alternatively how can I safely determine when the description is empty?
Note: I do not trust using {if category_description != '<p><br></p>'}
for a number of reasons. a) browser compatibility, b) varying results for empty category description, c) it's too hacky