+ firstChars: function(text) {
+ let preparedText = text
+ // Replace line jumps and <br> by spaces
+ .replace(/\n/g, " " )
+ .replace(/<br\/?>/g, " " )
+ .replace(/<[^>]+>/g, "") //remove remaining HTML tags
+ .replace(/[ ]+/g, " ") //remove series of spaces by only one
+ .trim();
+ const maxLength = 32; //arbitrary...
+ if (preparedText.length > maxLength)
+ return preparedText.substr(0,32) + "...";
+ return preparedText;
+ },