mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-12 13:56:30 -05:00
20 lines
440 B
Markdown
20 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>"
|
|
```
|