Skip to content

Instantly share code, notes, and snippets.

@pjlsergeant
Created May 23, 2011 16:30
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 pjlsergeant/986998 to your computer and use it in GitHub Desktop.
Save pjlsergeant/986998 to your computer and use it in GitHub Desktop.
[
abc =>
[ '<!--', "I am a comment" ], # This is a magic tag
[ '<![CDATA[', "I am some CDATA" ], # This is also a magic tag
"\nHere is &, an ampersand, which will be quoted automatically",
\"\nHere is &ampersand;, an ampersand - string refs are 'raw'",
[ 'bar', { 'foo' => "The first hashref is the attributes" }, "some stuff" ],
[ 'single_no_attr' ],
[ 'single_with_attr', { foo => 'bar' } ],
[ 'parent', ['child'], 'text', ['child'] ]
]
<abc>
<!-- I am a comment -->
<![CDATA[I am some CDATA]]>
Here is &ampersand;, an ampersand, which will be quoted automatically
Here is &ampersand;, an ampersand, which will be quoted automatically
<bar foo="The first hashref is the attributes">
some stuff
</bar>
<single_no_attr />
<single_with_attr foo="bar" />
<parent><child />text<child /></parent>
</abc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment