Return to Snippet

Revision: 20200
at November 9, 2009 13:06 by wizard04


Updated Code
For some reason, Snipplr has decided not to HTML-encode <code>&lt;</code> and <code>&gt;</code> signs (i.e., replacing them with `&lt;` and `&gt;`) that a user inputs into a comment box, and instead strips anything that looks like a tag from the comment entirely.

So, if you enter something like <code>&#96;&lt;div&gt;test&lt;/div&gt;&#96;</code> in the comment box, you would expect to see <code>&lt;div&gt;test&lt;/div&gt;</code> in the post but you would actually end up with `test`.

The exceptions that I've found are `<b>`, `<i>`, `<em>`, `<strong>`, and `<code>` tags.

The only reliable way to get around this odd implementation is to use the code tag with its content already HTML-encoded, just like you would if you were writing your own HTML. So entering something like <code>&lt;code&gt;&amp;lt;div&amp;gt;test&amp;lt;/div&amp;gt;&lt;/code&gt;</code> will give the expected result <code>&lt;div&gt;test&lt;/div&gt;</code>.

Note that you will also have to replace the back-ticks with `&#96;`

FYI, here is the code I used to create this description itself. The same code is entered in the first comment below (note the difference where the back-ticks are used to surround this: `<div>test</div>`).

Revision: 20199
at November 9, 2009 13:05 by wizard04


Updated Code
For some reason, Snipplr has decided not to HTML-encode <code>&lt;</code> and <code>&gt;</code> signs (i.e., replacing them with `&lt;` and `&gt;`) that a user inputs into a comment box, and instead strips anything that looks like a tag from the comment entirely.

So, if you enter something like <code>&#96;&lt;div&gt;test&lt;/div&gt;&#96;</code> in the comment box, you would expect to see <code>&lt;div&gt;test&lt;/div&gt;</code> in the post but you would actually end up with `test`.

The exceptions that I've found are `<b>`, `<i>`, `<em>`, `<strong>`, and `<code>` tags.

The only reliable way to get around this odd implementation is to use the code tag with its content already HTML-encoded, just like you would if you were writing your own HTML. So entering something like <code>&lt;code&gt;&amp;lt;div&amp;gt;test&amp;lt;/div&amp;gt;&lt;/code&gt;</code> will give the expected result <code>&lt;div&gt;test&lt;/div&gt;</code>.

Note that you will also have to replace the back-ticks with `&#96;`

FYI, here is the code I used to create this description itself. The same code is entered in the first comment below (note the difference where the back-ticks are used to surround this: `<div>foo & bar</div>`).

Revision: 20198
at November 9, 2009 13:02 by wizard04


Updated Code
For some reason, Snipplr has decided not to HTML-encode <code>&lt;</code> and <code>&gt;</code> signs (i.e., replacing them with `&lt;` and `&gt;`) that a user inputs into a comment box, and instead strips anything that looks like a tag from the comment entirely.

So, if you enter something like <code>&#96;&lt;div&gt;test&lt;/div&gt;&#96;</code> in the comment box, you would expect to see `<div>test</div>` in the post but you would actually end up with `test`.

The exceptions that I've found are `<b>`, `<i>`, `<em>`, `<strong>`, and `<code>` tags.

The only reliable way to get around this odd implementation is to use the code tag with its content already HTML-encoded, just like you would if you were writing your own HTML. So entering something like <code>&lt;code&gt;&amp;lt;div&amp;gt;test&amp;lt;/div&amp;gt;&lt;/code&gt;</code> will give the expected result <code>&lt;div&gt;test&lt;/div&gt;</code>.

Note that you will also have to replace the back-ticks with `&#96;`

FYI, here is the code I used to create this description itself. The same code is entered in the first comment below (note the difference where the back-ticks are used to surround the `<div>`).

Revision: 20197
at November 9, 2009 13:01 by wizard04


Updated Code
For some reason, Snipplr has decided not to HTML-encode <code>&lt;</code> and <code>&gt;</code> signs (i.e., replacing them with `&lt;` and `&gt;`) that a user inputs into a comment box, and instead strips anything that looks like a tag from the comment entirely.

So, if you enter something like `&#96;&lt;div&gt;test&lt;/div&gt;&#96;` in the comment box, you would expect to see `<div>test</div>` in the post but you would actually end up with `test`.

The exceptions that I've found are `<b>`, `<i>`, `<em>`, `<strong>`, and `<code>` tags.

The only reliable way to get around this odd implementation is to use the code tag with its content already HTML-encoded, just like you would if you were writing your own HTML. So entering something like `&lt;code&gt;&amp;lt;div&amp;gt;test&amp;lt;/div&amp;gt;&lt;/code&gt;` will give the expected result <code>&lt;div&gt;test&lt;/div&gt;</code>.

Note that you will also have to replace the back-ticks with `&#96;`

FYI, here is the code I used to create this description itself. The same code is entered in the first comment below (note the difference where the back-ticks are used to surround the `<div>`).

Revision: 20196
at November 9, 2009 12:54 by wizard04


Updated Code
For some reason, Snipplr has decided not to HTML-encode <code>&lt;</code> and <code>&gt;</code> signs (i.e., replacing them with `&lt;` and `&gt;`) that a user inputs into a comment box, and instead strips anything that looks like a tag from the comment entirely.

So, if you enter something like &#96;&lt;div&gt;test&lt;/div&gt;&#96;, you would expect to see `<div>test</div>` but you would actually end up with `test`.

The exceptions that I've found are `<b>`, `<i>`, `<em>`, `<strong>`, and `<code>` tags.

The only reliable way to get around this odd implementation is to use the code tag with its content already HTML-encoded, just like you would if you were writing your own HTML. So entering something like &lt;code&gt;&amp;lt;div&amp;gt;test&amp;lt;/div&amp;gt;&lt;/code&gt; will give the expected result <code>&lt;div&gt;test&lt;/div&gt;</code>.

Note that you will also have to replace the back-ticks with `&#96;`

FYI, here is the code I used to create this description itself. The same code is entered in the first comment below (note the difference where the back-ticks are used to surround the `<div>`).

Revision: 20195
at November 9, 2009 11:57 by wizard04


Initial Code
asdf

Initial URL

                                

Initial Description
For some reason, Snipplr has decided not to HTML-encode <code>&lt;</code> and <code>&gt;</code> signs (i.e., replacing them with `&lt;` and `&gt;`) that a user inputs into a comment box, and instead strips anything that looks like a tag from the comment entirely.

So, if you enter something like <code>&#96;&lt;div&gt;test&lt;/div&gt;&#96;</code> in the comment box, you would expect to see <code>&lt;div&gt;test&lt;/div&gt;</code> in the post but you would actually end up with `test`.

The exceptions that I've found are `<b>`, `<i>`, `<em>`, `<strong>`, and `<code>` tags.

The only reliable way to get around this odd implementation is to use the code tag with its content already HTML-encoded, just like you would if you were writing your own HTML. So entering something like <code>&lt;code&gt;&amp;lt;div&amp;gt;test&amp;lt;/div&amp;gt;&lt;/code&gt;</code> will give the expected result <code>&lt;div&gt;test&lt;/div&gt;</code>.

Note that you will also have to replace the back-ticks with `&#96;`

FYI, here is the code I used to create this description itself. The same code is entered in the first comment below (note the difference where the back-ticks are used to surround this: `<div>test</div>`).

Initial Title
--Snipplr-- Workaround: Code in Comments

Initial Tags
html

Initial Language
Other