title: Do I encode ampersands in <a href...>?
body: <p>I'm writing code that automatically generates HTML, and I want it to encode things properly.</p>
  
  <p>Say I'm generating a link to the following URL:</p>
  
  <pre><code>http://www.google.com/search?rls=en&amp;q=stack+overflow
  </code></pre>
  
  <p>I'm assuming that all attribute values should be HTML-encoded. (Please correct me if I'm wrong.)  So that means if I'm putting the above URL into an anchor tag, I should encode the ampersand as <code>&amp;amp;</code>, like this:</p>
  
  <pre><code>&lt;a href="http://www.google.com/search?rls=en&amp;amp;q=stack+overflow"&gt;
  </code></pre>
  
  <p>Is that correct?</p>