Improved preview generation

This commit is contained in:
M66B 2020-10-09 21:32:57 +02:00
parent c342b8c625
commit 561a1555a9
1 changed files with 4 additions and 1 deletions

View File

@ -1654,7 +1654,10 @@ public class HtmlHelper {
if (full)
return text;
return truncate(text, PREVIEW_SIZE);
String preview = text
.replace("\u200C", "") // Zero-width non-joiner
.replaceAll("\\s+", " ");
return truncate(preview, PREVIEW_SIZE);
}
static String truncate(String text, int at) {