Add support for custom text escaping (#11)
* Add support for custom text escaping * swift format * Remove withDefaultDelimiters * Update README.md * Don't pass content type into partial
This commit is contained in:
@@ -146,3 +146,9 @@ Hello world
|
||||
</body>
|
||||
```
|
||||
Note the `{{$head}}` section in `base.mustache` is replaced with the `{{$head}}` section included inside the `{{<base}}` partial reference from `mypage.mustache`. The same occurs with the `{{$body}}` section. In that case though a default value is supplied for the situation where a `{{$body}}` section is not supplied.
|
||||
|
||||
### Pragma
|
||||
|
||||
The syntax `{{% var: value}}` can be used to set template rendering configuration variables specific to Hummingbird Mustache. The only variable you can set at the moment is `CONTENT_TYPE`. This can be set to either to `HTML` or `TEXT` and defines how variables are escaped. A content type of `TEXT` means no variables are escaped and a content type of `HTML` will do HTML escaping of the rendered text. The content type defaults to `HTML`.
|
||||
|
||||
Given input object "<>", template `{{%CONTENT_TYPE: HTML}}{{.}}` will render as `<>` and `{{%CONTENT_TYPE: TEXT}}{{.}}` will render as `<>`.
|
||||
|
||||
Reference in New Issue
Block a user