`](#invoke) directive can be used invoke a macro function using named attributes. The following sample template shows how to use macro functions inside expressions:
```xml
Hello ${name}! You have ${count} new messages.
```
# Structure Manipulation
## Dynamic attributes
The `attrs` attribute allows attributes to be dynamically added to an element at runtime. The value of the attrs attribute should be an expression that resolves to an object with properties that correspond to the dynamic attributes. For example:
```xml
Hello World!
```
Output:
```html
Hello World!
```
## body-only-if
If you find that you have a wrapper element that is conditional, but whose body should always be rendered then you can use the `body-only-if` attribute to handle this use case. For example, to only render a wrapping `` tag if there is a valid URL then you could do the following:
```xml
Some body content
```
Given a value of `"http://localhost/"` for the `data.linkUrl` variable: , the output would be the following:
```xml
Some body content
```
Given a value of `undefined` for the `data.linkUrl` variable: , the output would be the following:
```xml
Some body content
```
# Comments
Standard HTML comments can be used to add comments to your template. The HTML comments will not show up in the rendered HTML.
Example comments:
```xml
Hello
```
If you would like for your HTML comment to show up in the final output then you can use the custom `html-comment` tag:
```xml
This is a comment that *will* be rendered
Hello
```
Output:
```xml
Hello
```
# Whitespace
The Marko compiler will remove unnecessary whitespace based on some builtin rules, by default. These rules are partially based on the rules that browser's use to normalize whitespace and partially based on the goal of allowing nicely indented markup with minified output. These rules are as follows:
- For text before the first child element: `text.replace(/^\n\s*/g, '')`
- For text after the last child element: `text.replace(/\n\s*$/g, '')`
- For text between child elements: `text.replace(/^\n\s*$/g, '')`
- Any contiguous sequence of whitespace characters is collapsed into a single space character
In addition, whitespace within the following tags is preserved by default:
- ``
- `