diff options
-rw-r--r-- | src/lib/messages.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/messages.sh b/src/lib/messages.sh index a6f1460..10c0400 100644 --- a/src/lib/messages.sh +++ b/src/lib/messages.sh @@ -3,7 +3,7 @@ # Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com> # Copyright (C) 2012 Nicolás Reynolds <fauno@parabola.nu> -# Copyright (C) 2012-2014, 2016-2017 Luke Shumaker <lukeshu@parabola.nu> +# Copyright (C) 2012-2014, 2016-2018 Luke Shumaker <lukeshu@parabola.nu> # # For just the setup_traps() function: # Copyright (C) 2002-2006 Judd Vinet <jvinet@zeroflux.org> @@ -80,7 +80,8 @@ whitespace_collapse() { tr '\n' '\r' | sed -r \ -e 's/\r/ /g' -e 's/\t/ /g' \ - -e 's/(^|[^.!? ]) +/\1 /g' -e 's/([.!?]) +/\1 /g' + -e 's/(^|[^.!? ]) +/\1 /g' -e 's/([.!?]) +/\1 /g' \ + -e 's/\s+$//' } |