normalize line endings

This commit is contained in:
Unrud 2018-08-23 17:12:35 +02:00
parent 5a5ad3e6c6
commit ed74ab60e4

View file

@ -57,6 +57,9 @@ func processCommand(plugin Plugin, command string) error {
}
if command[0] == 't' {
text := command[1:]
// normalize line endings
text = strings.Replace(text, "\r\n", "\n", -1)
text = strings.Replace(text, "\r", "\n", -1)
if !utf8.ValidString(text) {
return errors.New("invalid utf-8")
}