Canonicalize line endings for text messages (#86)

* Canonicalize line endings for text messages

* Improve cleartext messages
This commit is contained in:
wussler 2020-10-12 21:24:33 +02:00 committed by GitHub
parent a4d89bce32
commit ce607e0fa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 25 deletions

View file

@ -7,9 +7,9 @@ import (
"github.com/ProtonMail/gopenpgp/v2/constants"
)
// TrimNewlines removes whitespace from the end of each line of the input
// TrimWhitespace removes whitespace from the end of each line of the input
// string.
func TrimNewlines(input string) string {
func TrimWhitespace(input string) string {
var re = regexp.MustCompile(`(?m)[ \t]*$`)
return re.ReplaceAllString(input, "")
}