Skip to content

Commit

Permalink
custom escape function docs
Browse files Browse the repository at this point in the history
  • Loading branch information
no1msd committed Feb 1, 2016
1 parent 57196d0 commit ff45906
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,22 @@ Output:
<b>3</b>: Scott
```

### Custom escape function

By default, mstch uses HTML escaping on the output, as per specification. This
is not useful if your output is not HTML, so mstch provides a way to supply
your own escape implementation. Just assign any callable object to the static
`mstch::config::escape`, which is an initially empty
`std::function<std::string(const std::string&)>`.

For example you can turn off escaping entirely with a lambda:

```c++
mstch::config::escape = [](const std::string& str) -> std::string {
return str;
};
```

## Requirements

- A C++ compiler with decent C++11 support. Currently tested with:
Expand Down

0 comments on commit ff45906

Please sign in to comment.