Skip to content

Commit

Permalink
Fix: add ** to limitdescription to fix strong tag
Browse files Browse the repository at this point in the history
  • Loading branch information
thomlamb committed Aug 16, 2024
1 parent 95d3297 commit d19643f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ const NewsCard = ({ item, showCategoriesOrTopics, contextAuthenticatedUser }) =>

useEffect(() => {
if (description.length >= numberLimit) {
setLimitDescription(description.substring(0, numberLimit) + "...");
let truncatedDescription = description.substring(0, numberLimit);
if (description.endsWith("**")) {
truncatedDescription += "**";
}
setLimitDescription(truncatedDescription + "...");
} else {
setLimitDescription(description);
}
Expand Down

0 comments on commit d19643f

Please sign in to comment.