Note that you should not use mark_raw in templates because it can make security hole easily just like as type casts in C. If you want to generate HTML components dynamically, e.g. by HTML form builders, application code should be responsible to make strings as marked raw.

Macros are supported, which are called in the same way as functions and return a raw string. Macros returns what their bodies render, so they cannot return references nor objects including other macros.

You can add - to the immediate start or end of a directive tag to control the newline chomping options to keep the output clean. The starting - removes leading newlines and the ending - removes trailing ones.