From 8eb42c9ba0912e642e39a04b5165c467a498508b Mon Sep 17 00:00:00 2001 From: LemonAndroid Date: Tue, 4 Sep 2018 07:46:20 +0200 Subject: [PATCH] Don't add tailing characters for words > 22 --- content/js/spray-reader.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/js/spray-reader.js b/content/js/spray-reader.js index 23e6df3..040ac73 100644 --- a/content/js/spray-reader.js +++ b/content/js/spray-reader.js @@ -129,8 +129,12 @@ function pivot(word){ else{ + word = '.......' + word; + var tail = 22 - (word.length + 7); - word = '.......' + word + ('.'.repeat(tail)); + if(tail > 0) { + word + ('.'.repeat(tail)); + } var start = word.slice(0, word.length/2); var end = word.slice(word.length/2, word.length);