title: How to remove whitespace around a character in a Django Template?
body: <p>I have a template that looks like this:</p>
  
  <pre><code>({% if condition_a %}
   &lt;a href="{{ link_a }}" role="button"&gt;Add&lt;/a&gt;
  {% endif %}
  {% if condtion_a and condition_b %} | {% endif %}
  {% if condition_b %}
   &lt;a href="{{ link_b }}"&gt;Edit&lt;/a&gt;
  {% endif %})
  </code></pre>
  
  <p>I was hoping it would render with the parentheses next to the words. For example, in the case of <code>condition_a</code>:</p>
  
  <p>(Add)</p>
  
  <p>But due to the way html handles line breaks, the page is rendered like this:</p>
  
  <p>( Add )</p>
  
  <p>The same is true for the other conditions (ie. <code>condition_a and conditon_b</code>):</p>
  
  <p>Expected:</p>
  
  <p>(Add | Edit)</p>
  
  <p>Result: </p>
  
  <p>( Add | Edit )</p>
  
  <p>I tried adding the Django <code>spaceless</code> tag, but that didn't work as it only strips whitespace around html tags. I could jam a few more <code>if</code> statements in to my code, but would prefer not to. </p>
  
  <p>I also tried adding <code>white-space: nowrap;</code> to the css but that failed as well.</p>
  
  <p>Is there any way I can trim the whitespace around words? </p>