Skip to content

Instantly share code, notes, and snippets.

@seansullivan
Created March 7, 2014 18:29
Show Gist options
  • Save seansullivan/9417054 to your computer and use it in GitHub Desktop.
Save seansullivan/9417054 to your computer and use it in GitHub Desktop.
Multi-line string in JavaScript -- heredoc
var string = (<r><![CDATA[
The text string goes here. Since this is a XML CDATA section,
stuff like <> work fine too, even if definitely invalid XML.
]]></r>).toString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment