summaryrefslogtreecommitdiff
path: root/src/lib/librelib
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-05-24 23:55:55 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-05-24 23:55:55 -0600
commitc2cd219b2077de4ec3c6659b23f60492f26c8737 (patch)
tree3925074377378a89eb852f867646b07d16ae52b8 /src/lib/librelib
parentfdc6a869747edfc7f9ffa1603a36ee33bda0aa4f (diff)
libremessages: expose whitespace-collapse
Diffstat (limited to 'src/lib/librelib')
-rwxr-xr-xsrc/lib/librelib4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/librelib b/src/lib/librelib
index e4c933a..bc5c5ed 100755
--- a/src/lib/librelib
+++ b/src/lib/librelib
@@ -34,14 +34,14 @@ print() {
printf -- "$mesg\n" "$@"
}
-_html_whitespace_collapse() {
+whitespace-collapse() {
tr '\n' '\r' | sed -r \
-e 's/\r/ /g' -e 's/\t/ /g' \
-e 's/(^|[^.!? ]) +/\1 /g' -e 's/([.!?]) +/\1 /g'
}
prose() {
- local mesg="$(_ "$(_html_whitespace_collapse <<<"$1")")"; shift
+ local mesg="$(_ "$(whitespace-collapse <<<"$1")")"; shift
printf -- "$mesg" "$@" | fmt -u
}