---
title: hr
description: "Place a horizontal rule around text."
---

# hr

Place a horizontal rule around text.

## Syntax

```knap
{{ value | hr }}
{{ value | hr:before }}
{{ value | hr:both }}
```

## Usage

- Use `after` (the default), `before`, or `both` to choose the rule position.
- The filter emits `---` and separates it from content with a blank line.
- For arrays and objects, including serialized collections from another filter, string values are formatted recursively while keys and non-string values are preserved.

## Examples

### After

```json title="Data"
{
  "text": "Section end"
}
```

```knap title="Template"
{{ text | hr }}
```

```md title="Output"
Section end

---
```

### Before

```json title="Data"
{
  "text": "Section start"
}
```

```knap title="Template"
{{ text | hr:before }}
```

```md title="Output"
---

Section start
```
