Skip to content

Instantly share code, notes, and snippets.

@sytelus
Created January 2, 2014 04:59
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 sytelus/8215246 to your computer and use it in GitHub Desktop.
Save sytelus/8215246 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<textarea id="n1"></textarea>
<br/>
<textarea id="n2"></textarea>
</body>
</html>
var tmpl = Handlebars.compile("{{name}} {{name2}}{{{name}}}"),
name = new Handlebars.SafeString("<p>abc\nxyz</p>"),
name2= "<p>abc\nxyz</p>"
;
$('#n1').val( tmpl({ name: name }) );
$('#n2').val( tmpl({ name2: name2 }) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment