Answers.Body: <p>You can use the <a href="http://twig.sensiolabs.org/doc/filters/striptags.html" rel="nofollow"><code>striptags</code></a> filter to remove all HTML tags from your string. With the <a href="http://twig.sensiolabs.org/doc/filters/trim.html" rel="nofollow"><code>trim</code></a> filter you can strip all whitespace from the beginning and the end of it:</p>
  
  <pre><code>{% if entry.poorText|striptags|trim %}
      {{ entry.poorText }}
  {% else %}
      Here could be a nicely formatted text! 
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-18T18:06:15.813Z
Answers.Text: in twig, an empty string evaluates to `false`, so you could just test `{% if entry.poorText|striptags|trim %}`
Answers.UserDisplayName: Marion Newlevant
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-18T18:12:53.577Z
Answers.Text: Right. Thx @Marion.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-18T16:34:51.873Z
Answers.LastActivityDate: 2014-12-18T18:13:15.963Z
Answers.LastEditDate: 2014-12-18T18:13:15.963Z
Answers.UserDisplayName: carlcs
Body: <p>I have a rich text field which contains:</p>
  
  <pre><code>&lt;p&gt;&lt;br&gt;&lt;/p&gt;
  </code></pre>
  
  <p>This is what is left when you delete all content of a redactor field.
  This can't be deleted without the HTML view of Redactor.</p>
  
  <p>Is it possible to write a conditional that checks for an empty field ignoring HTML markup?</p>
  
  <pre><code>{% if entry.poorText is not empty %}
     {{ entry.poorText }}
  {% endif %}
  </code></pre>
  
  <p>Does not work in this case.</p>
  
Tags: <conditional><redactor><richtext>
Title: Test for empty RichText field
ThreadText: # Test for empty RichText field
  
  (Asked by: username_0 on 2014-12-18)
  
  I have a rich text field which contains:
  
  ```
  <p><br></p>
  
  ```
  
  This is what is left when you delete all content of a redactor field.
  This can't be deleted without the HTML view of Redactor.
  
  Is it possible to write a conditional that checks for an empty field ignoring HTML markup?
  
  ```
  {% if entry.poorText is not empty %}
     {{ entry.poorText }}
  {% endif %}
  
  ```
  
  Does not work in this case.
  
  **Tags:** conditional, redactor, richtext
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-12-18. Score: 6 | Accepted answer
  
  You can use the [`striptags`](http://twig.sensiolabs.org/doc/filters/striptags.html) filter to remove all HTML tags from your string. With the [`trim`](http://twig.sensiolabs.org/doc/filters/trim.html) filter you can strip all whitespace from the beginning and the end of it:
  
  ```
  {% if entry.poorText|striptags|trim %}
      {{ entry.poorText }}
  {% else %}
      Here could be a nicely formatted text! 
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_2**: in twig, an empty string evaluates to `false`, so you could just test `{% if entry.poorText|striptags|trim %}`  
  > **username_1**: Right. Thx @username_2.  
  
  ---
  
  