2013-01-24 78 views

回答

41

使用字符引用来表示它:&

specification

The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they MUST be escaped using either numeric character references or the strings " &amp; " and " &lt; " respectively. The right angle bracket (>) may be represented using the string " &gt; ", and MUST, for compatibility, be escaped using either " &gt; " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end of a CDATA section.

+0

我喜欢这个回答比其他问题的答案要好,因为它引用了规范和我能够逃脱所有潜在的字符,而不是OP的一个字符 – RozzA

相关问题