Skip to content

Commit a5ebb15

Browse files
committed
Don’t truncate text that doesn’t require truncation
fixes #1163
1 parent 5a8069d commit a5ebb15

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/core/text.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ export function truncateText(
127127
};
128128

129129
const lengthResult = trimLength(text, length);
130-
131130
if (lengthResult.trimmed) {
132131
// This was shortened
133132
if (breakAt === "punctuation") {
@@ -137,10 +136,6 @@ export function truncateText(
137136
}
138137
} else {
139138
// This wasn't shortened
140-
if (breakAt === "punctuation") {
141-
return trimPunc(lengthResult.text);
142-
} else {
143-
return trimEnd(lengthResult.text);
144-
}
139+
return lengthResult.text;
145140
}
146141
}

0 commit comments

Comments
 (0)