Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If your document is unicode, you only need to escape the same ones as for XML in your text <sup>[<a href="http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2" rel="noreferrer">spec</a>] [<a href="http://www.w3.org/International/questions/qa-escapes#use" rel="noreferrer">doc</a>]</sup>:</p> <pre class="lang-none prettyprint-override"><code>&amp; becomes &amp;amp; &lt; becomes &amp;lt; &gt; becomes &amp;gt; </code></pre> <p>In attribute values you must also escape the quote character <sup>[<a href="http://www.w3.org/TR/html4/charset.html#h-5.3.2" rel="noreferrer">spec</a>]</sup>:</p> <pre><code>" becomes &amp;quot; ' becomes &amp;#39; </code></pre> <p>If your document is ASCII or another non-Unicode encoding and you're using characters that aren't supported, you'll need to escape them. Otherwise, you're fine<sup>1</sup>.</p> <p>You usually do not want to escape spaces as <code>&amp;nbsp;</code>. <code>&amp;nbsp;</code> is not a normal space, it's a non-breaking space <sup>[<a href="http://en.wikipedia.org/wiki/Non-breaking_space" rel="noreferrer">wiki</a>]</sup>. You can use these instead of normal spaces to prevent a line break from being inserted between two words, or to insert&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;extra&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;space&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;without it being automatically collapsed, but you won't need to do this very often.</p> <hr> <p><sup>1</sup> You're fine, as long as you're inserting the escaped text somewhere that it makes sense to insert ordinary text (i.e. not inside a <code>&lt;style&gt;</code> or <code>&lt;script&gt;</code> tag, and not inside an attribute value). Otherwise you must take other precautions as mentioned in <a href="https://stackoverflow.com/a/7382443/1114">daxelrod's answer</a> and <a href="https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#XSS_Prevention_Rules" rel="noreferrer">described here by the Open Web Application Security Project</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload