hugo/docs/content/en/functions/chomp.md
2023-05-22 16:47:07 +02:00

21 lines
440 B
Markdown

---
title: chomp
toc: true
description: Removes any trailing newline characters.
categories: [functions]
menu:
docs:
parent: functions
keywords: [trim]
signature:
- "chomp INPUT"
- "strings.Chomp INPUT"
relatedfuncs: [truncate]
---
Useful in a pipeline to remove newlines added by other processing (e.g., [`markdownify`](/functions/markdownify/)).
```go-html-template
{{ chomp "<p>Blockhead</p>\n" }} → "<p>Blockhead</p>"
```