---
title: hard_break
description: "Turn single newlines into Markdown hard line breaks."
---

# hard_break

Turn single newlines into Markdown hard line breaks.

## Syntax

```knap
{{ value | hard_break }}
```

## Usage

- Two trailing spaces are added before single newlines. Blank lines between paragraphs are preserved.
- For arrays and objects, including serialized collections from another filter, string values are formatted recursively while keys and non-string values are preserved.

## Example

```json title="Data"
{
  "text": "First line\nSecond line\n\nNew paragraph"
}
```

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

```md title="Output"
First line  
Second line

New paragraph
```
