noautoesc - Apache FreeMarker Manual

Unsupported web browser - Use a modern browser to view this website!

- Home
- Manual
- Java API

- Contribute
- Report a Bug
- Download

Manual
Previous Next

# noautoesc

## Synopsis

    <#noautoesc>
      ...
    </#noautoesc>

Camel case name variant: `noAutoEsc`

## Description

Disables auto-escaping in the nested section. Note that to prevent escaping for just a single `${expression}` you should use `${expression?no_esc}` instead.

This directive only has effect on the section that is literally (as in the text editor) inside the nested block, not on the parts that are called/included from there.

Example:

Template

    <#ftl output_format="XML">
    ${"&"}
    <#noautoesc>
      ${"&"}
      ...
      ${"&"}
    </#noautoesc>
    ${"&"}

Output

    &amp;
      &
      ...
      &
    &amp;

`noautoesc` can be used regardless of what the current output format is (unlike the `autoesc` directive).

`noautoesc` can also be used nested into `autoesc` directive to re-enable escaping.

`noautoesc` can be used on places where auto-escaping is already disabled, such as even inside another `noautoesc` block. Doing so is redundant but allowed.

Previous Next