diff --git a/src/examples/escaping.md b/src/examples/escaping.md new file mode 100644 index 00000000..ac837911 --- /dev/null +++ b/src/examples/escaping.md @@ -0,0 +1,12 @@ +--- +layout: playground +example: + template: | + {{{{raw}}}} + {{raw block}} + {{{{/raw}}}} + preparationScript: | + Handlebars.registerHelper('raw', function(options) { + return options.fn() + }); +--- diff --git a/src/guide/expressions.md b/src/guide/expressions.md index 579b4263..1e0fa4fd 100644 --- a/src/guide/expressions.md +++ b/src/guide/expressions.md @@ -304,17 +304,29 @@ will render ::: v-pre -Handlebars content may be escaped in one of two ways, inline escapes or raw block helpers. Inline escapes created by -prefixing a mustache block with `\`. Raw blocks are created using `{{{{` mustache braces. +Handlebars content may be escaped in one of two ways, inline escapes or raw block helpers. -::: +Inline escapes created by prefixing a mustache block with `\`. ```handlebars \{{escaped}} -{{#raw}} - \{{escaped}} -{{/raw}} ``` +will render + +```html +{{escaped}} +``` + +Raw blocks are created using `{{{{` mustache braces with a block helper. Note that the `#` has been removed. The `raw` +helper shown below is not a built-in helper. + +::: + + + + Raw blocks operate in the same manner as other [block helpers](block-helpers.html) with the distinction of the child content is treated as a literal string. + +