I seem to recall that there is an HTML tag that escapes absolutely everything inside it except the matching closing tag. Kind of like <plaintext>
but not fundamentally broken.
Asked
Active
Viewed 1.1k times
3 Answers
12
<xmp> is the tag you are looking for:
<xmp>some stuff <tags></tags> too</xmp>
But, since it's depricated, the best you can get is <pre>.

EndangeredMassa
- 17,208
- 8
- 55
- 79
-
1Sweet! I've been wanting a tag like this! – Lawrence Dol Dec 17 '08 at 04:43
-
1is deprecated -- it should not be used. See http://www.htmlcodetutorial.com/_XMP.html. – Ken Paul Dec 17 '08 at 05:29
-
Unfortunately `
` can't properly escape string like this ` – kirogasa Aug 18 '23 at 17:55`, very close, but no. I haven't found anything better than ` `.
6
You need to use <pre><code> ... </code></pre>
.
<xmp>
is deprecated and should not be used. See http://www.htmlcodetutorial.com/_XMP.html.

Ken Paul
- 5,685
- 2
- 30
- 33
-
Ditto Mohit. just tested that with a html document in side
– BCS Dec 17 '08 at 07:59, FF2 gave a blank screen
-
http://www.htmlref.com/Reference/AppA/tag_xmp.htm seems that it works most places (and what better can you get with HTML anyway?) – BCS Dec 17 '08 at 08:00
1
There is also the XML CDATA:
<![CDATA[stuff that is <tag>never</tag> parsed]]>
Whether this works in an HTML document is probably up to the browser. However, it should certainly work in an XHTML document.

Greg Hewgill
- 951,095
- 183
- 1,149
- 1,285