Fix content tests

This commit is contained in:
Jon Staab
2025-03-27 11:07:17 -07:00
parent 4e49410b8b
commit d8bbb5dd6a
+3 -2
View File
@@ -421,13 +421,14 @@ export const truncate = (
// Otherwise, truncate more then necessary so that when the user expands the note // Otherwise, truncate more then necessary so that when the user expands the note
// they have more than just a tiny bit to look at. Truncating a single word is annoying. // they have more than just a tiny bit to look at. Truncating a single word is annoying.
sizes.every((size, i) => { sizes.every((size, i) => {
currentSize += size
if (currentSize > minLength) { if (currentSize > minLength) {
content = content.slice(0, i).concat({type: ParsedType.Ellipsis, value: "…", raw: ""}) content = content.slice(0, Math.max(1, i)).concat({type: ParsedType.Ellipsis, value: "…", raw: ""})
return false return false
} }
currentSize += size
return true return true
}) })