---
title: highlight
description: "Wrap text in highlight markers."
---

# highlight

Wrap text in highlight markers.

## Syntax

```knap
{{ value | highlight }}
{{ value | highlight:blue }}
```

## Usage

- Optionally pass `red`, `orange`, `yellow`, `green`, `blue`, or `purple` to add a color marker.
- Leading and trailing whitespace stays outside inline markers.
- For arrays and objects, including serialized collections from another filter, string values are formatted recursively while keys and non-string values are preserved.

## Examples

### Default

```json title="Data"
{
  "text": "Remember this"
}
```

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

```md title="Output"
==Remember this==
```

### Color

```json title="Data"
{
  "text": "Remember this"
}
```

```knap title="Template"
{{ text | highlight:blue }}
```

```md title="Output"
==🔵Remember this==
```

## Related filters

- [bold](/filters/bold)
- [italic](/filters/italic)
- [strike](/filters/strike)
