Anvil | Smiths Smiths | Register Register | Login Login |
Search:
Show links Show tools Show tree | Previous document Next document | njet.org > Anvil > Documentation > Language reference > Templates > Tags > <preserve>, <compress> and <silent>

Content control

  <preserve>
  <compress>
  <silent>
  <pack>

The content control tags affects how character datas and non-template tags are processed and outputted. Behaviour is in effect until the end of function, or up to the next content control tag. Note that these tags does nothing on runtime; all actions are performed during compilation.

preserve
Content is treated as it is expressed in templates.
compress
Whitespace sequences are compressed into single whitespace:
  • to line feed if there was line feeds on compressed sequence
  • to space if there wasn't.
pack
Whitespace sequences are compressed into single space. Extra whitespace from beginning and end are removed altogether.
compress
Character data and non-template tags are not outputted.

Content control behaviour is also affected by preserve, compress and silent attributes in module, namespace, class and function definitions.

See also  | Tags  | <module>  | <function>  | Statement tags  | Character data  | <namespace>  | <class>
Contributes notes:
Add a note
What's new | Anvil