如何避免HTML中的一个块中的所有内容 [英] How to escape everything in a block in HTML

查看:67
本文介绍了如何避免HTML中的一个块中的所有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我好像还记得,除了匹配的关闭标签之外,还有一个HTML标签可以绝对地转义其中的所有内容。类似 < plaintext> 但没有根本的破坏。

解决方案

< xmp>是您要查找的标签:

 < xmp>一些东西<标签>< / tags>太< / XMP> 

但是,由于它被删除,您可以获得的最好的是< pre>。


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.

解决方案

<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>.

这篇关于如何避免HTML中的一个块中的所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆