javascript - Can't highlight xml syntax with highlight.js -
i'm trying print xml on html page.
exemple:
<pre><code class="xml"> <?xml version="1.0"?> <response value="ok" xml:lang="en"> <text>ok</text> <comment html_allowed="true"/> <ns1:description><![cdata[ cdata <not> escape <tags like="this"></tags></not>. ]]></ns1:description> <a></a> <a/> </response> </code></pre>
i'd use highlight.js highlight code on page there's conflict xml , html.
i had success php code using <pre><code class="php"></code></pre>
, haven't tried other languages. way found display xml code in textarea, i'd prefer show xml sweet syntax-highlighting.
i have made jsfiddle illustrate problem.
hope can help.
you should escape angle brackets <
, >
when want display them literally. otherwise have actual markup within <code>
element browsers try interpret. has nothing javascript applied it.
Comments
Post a Comment