Skip to content

Instantly share code, notes, and snippets.

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 umidjons/b3e1d7f5a7093e2e4e5a to your computer and use it in GitHub Desktop.
Save umidjons/b3e1d7f5a7093e2e4e5a to your computer and use it in GitHub Desktop.
Handlebars.js helper to unescape double quotes

Handlebars.js helper to unescape double quotes

Handlebars.registerHelper('unescape',function(str){
	return str.replace(/\\"/g,'"'); // replace all \" to "
});

Usage example:

<div class="panel panel-default">
	<div class="panel-heading"><h3 class="panel-title">Description</h3></div>
	<div class="panel-body">
		{{unescape description}}
	</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment