如何使用车把js在laravel 4.2中转义html?

This is my html code in laravel blade.

<script id="expressions-template" type="text/x-handlebars-template">
   @{{description.escaped}}
   @{{example}}

   @{{description.unescaped}}
   @{{{example}}}

</script>

<div class="content-placeholder"></div>

This is my js script for compile the template with data

$(function () {
 // Grab the template script
 var theTemplateScript = $("#expressions-template").html();

 // Compile the template
 var theTemplate = Handlebars.compile(theTemplateScript);

 // Define our data object
 var context={
   "description": {
      "escaped": "Using {{}} brackets will result in escaped HTML:",
      "unescaped": "Using {{{}}} will leave the context as it is:"
      },
   "example": "<button> Hello </button>"
   };

 // Pass our data to the template
 var theCompiledHtml = theTemplate(context);

 // Add the compiled html to the page
  $('.content-placeholder').html(theCompiledHtml);

 });

laravel (4.2) blade does not escape html tags, its just print html tags as text.

Blade::setEscapedContentTags('[[', ']]');
Blade::setContentTags('[[[', ']]]');

use different tags for a single view, you can set the tags in the closure or controller action that will generate the view.

Use curly braces for handlebar templates.