From 21bf3a2455ed1ac0c60efd7265c044bafdddff10 Mon Sep 17 00:00:00 2001 From: bignutty <3515180-bignutty@users.noreply.gitlab.com> Date: Sat, 11 Jan 2025 02:52:22 +0100 Subject: [PATCH] update stringwrap logic --- labscore/utils/markdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/labscore/utils/markdown.js b/labscore/utils/markdown.js index eb06dd0..46e41d9 100644 --- a/labscore/utils/markdown.js +++ b/labscore/utils/markdown.js @@ -46,8 +46,8 @@ module.exports.timestamp = function(time, flag = "t"){ module.exports.stringwrap = function(content = "", length, newlines = true){ if(!newlines) content = content.replace(/\n/, ' ') if(content.length > length){ - c = content.substr(0, length) + '...'; - while(c.endsWith(' ...')) c = c.substr(0, c.length - 4) + '...'; + c = content.substr(0, length-1) + '…'; + while(c.endsWith(' …')) c = c.substr(0, c.length - 2) + '…'; return c; } return content;