title: Optional line-breaking HTML entity that is always invisible
body: <p>I want an optional line-breaking character that is always invisible that works with the <code>word-wrap: break-word;</code> CSS style.</p>
  
  <p>Here are some specifics. My goal is to break apart long links in reasonable places. These characters are a good place to start: <code>-</code>, <code>.</code>, <code>_</code>, <code>/</code>, <code>\</code>. This is not a Rails-specific question, but I wanted to share some code I'm using now:</p>
  
  <pre><code>module ApplicationHelper
    def with_optional_line_breaks(text)
      text.gsub(%r{([-._/\\])}, '\1&amp;shy;')
    end
  end
  </code></pre>
  
  <p>Here's the problem with the code above: when <code>&amp;shy;</code> takes effect (in a table with: <code>word-wrap: break-word;</code>), <code>&amp;shy;</code> gets displayed as <code>-</code>. I don't want to see the <code>-</code>; I want a line break without any character shown.</p>
  
  <hr>