title |
linkTitle |
description |
categories |
keywords |
menu |
function |
relatedFunctions |
aliases |
chomp |
chomp |
Removes any trailing newline characters. |
|
|
|
aliases |
returnType |
signatures |
|
any |
|
|
strings.Chomp |
strings.Trim |
strings.TrimLeft |
strings.TrimPrefix |
strings.TrimRight |
strings.TrimSuffix |
|
|
If the argument is of type template.HTML, returns template.HTML, else returns a string.
Useful in a pipeline to remove newlines added by other processing (e.g., markdownify
).
{{ chomp "<p>Blockhead</p>\n" }} → "<p>Blockhead</p>"