English 中文(简体)
• 如何保存原始XML/超文本及其在PRE标签内的格式
原标题:How to preserve raw XML / HTML and its formatting inside of a PRE-tag

当我选择“View page source”时,我看到正确的结果:

<variable name="myPublicVar" type="String">
  <metadata name="MemberMetaExamplePublic" />
</variable>
<accessor name="myAccessor" access="readwrite" type="Boolean" declaredBy="MetadataTest">
  <metadata name="MemberMetaExampleGetter" />
</accessor>
<method name="myMethod" declaredBy="MetadataTest" returnType="void">
  <metadata name="MemberMetaExampleMethod" />
</method>
<metadata name="CustomMeta">
  <arg key="param1" value="foo" />
  <arg key="param2" value="bar "/>
</metadata>

但是,当我使用j Query来取代每一带;和”;到处;以及到处;以及到处;到处;以及到处;到处都由浏览器( Chrome)得出的结果,是自封的要素:

<variable name="myPublicVar" type="String">
  <metadata name="MemberMetaExamplePublic">
</metadata></variable>
<accessor name="myAccessor" access="readwrite" type="Boolean" declaredby="MetadataTest">
  <metadata name="MemberMetaExampleGetter">
</metadata></accessor>
<method name="myMethod" declaredby="MetadataTest" returntype="void">
  <metadata name="MemberMetaExampleMethod">
</metadata></method>
<metadata name="CustomMeta">
  <arg key="param1" value="foo">
  <arg key="param2" value="bar ">
</arg></arg></metadata>

通知如下:<代码><metadata> 内容不一定产生封闭标签;<arg>s in the final one不正确地生成了封闭标记,实际包装了<arg> into another <arg>

转换一的使用在本节中出现。

$( pre.raw ).each( function(pIndex, pDIV) {
  pDIV.innerHTML = pDIV.innerHTML.replace(/</g, "&lt;").replace(/>/g, "&gt;");
});

能够做些什么来阻止法典的教化? 我不怀疑行凶者是否责怪、 j或 Java?

<>m>NOTE:虽然我把这个问题放在了Wordpress,而且我可在wordpress.stack Exchange.com网站上查询,但我认为这是一个一般性问题,可在各种网络发展情景中找到。

问题回答

首先,将标题改为。 Don t 要求浏览器从无效的超文本中产生多功能,然后从由此产生的多功能系统中产生超文本,然后试图确定超文本,将其退回。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!