Skip to content

Instantly share code, notes, and snippets.

@davidl
Created November 30, 2012 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidl/4176483 to your computer and use it in GitHub Desktop.
Save davidl/4176483 to your computer and use it in GitHub Desktop.
Demo for Prism.js pull request 61 re: empty CDATA sections
/* Demo for Prism.js pull request 61 re: empty CDATA sections */
<!-- Demo for Prism.js pull request 61 re: empty CDATA sections -->
<!-- https://github.com/LeaVerou/prism/pull/61 -->
<demo>
<hello>This is a demo of XML-style markup with some CDATA sections (empty and non-empty) for <a href="https://github.com/LeaVerou/prism/pull/61">Prism pull request 61</a>. Note how Prism (in the "HTML & Result" panel) highlights the markup:</hello>
<demo-content status="wraps-correctly">
<text>A non-empty CDATA section works great!</text>
<data><![CDATA[&lt;p>Not empty&lt;/p&gt;]]></data>
</demo-content>
<demo-content status="wraps-correctly">
<text>A non-empty CDATA section works great:</text>
<data><![CDATA[&lt;p&gt;Not empty&lt;/p&gt;]]></data>
<text>Another non-empty CDATA section also works great:</text>
<data><![CDATA[&lt;p&gt;Not empty&lt;/p&gt;]]></data>
</demo-content>
<demo-content status="wraps-incorrectly">
<text>An empty CDATA section:</text>
<data><![CDATA[]]></data>
<text>Another empty CDATA section:</text>
<data><![CDATA[]]></data>
</demo-content>
<demo-content status="wraps-incorrectly">
<text>An empty CDATA section causes Prism to insert an element wrapping the CDATA tag and all content up to the "]]>" text in the second "text" node.</text>
<data><![CDATA[]]></data>
<text>]]></text>
</demo-content>
</demo>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"","page":"html"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment