Post Card: omit ellipses if description is short enough already

If the text is below the maximum length, just show the whole thing
without adding a "..." at the end
This commit is contained in:
Hippo 2019-12-24 13:51:38 +05:30
parent 2c63ea707e
commit 9b448913fa
1 changed files with 1 additions and 0 deletions

View File

@ -67,6 +67,7 @@ export default {
filters: {
truncate: (text, length, suffix) => {
if (!text) return text
if (text.length <= length) return text
return text.substring(0, length) + suffix;
},
stripHTML: text => {