From 1e9f89eedc4ede8440352472bd9a4f4c7701836f Mon Sep 17 00:00:00 2001 From: Viktor Shen Date: Thu, 6 Feb 2025 02:34:13 +0100 Subject: [PATCH] actual fix for word breaking --- src/components/AnimatedMarkdown.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/AnimatedMarkdown.tsx b/src/components/AnimatedMarkdown.tsx index 0d63311..863da8f 100644 --- a/src/components/AnimatedMarkdown.tsx +++ b/src/components/AnimatedMarkdown.tsx @@ -180,8 +180,17 @@ const MarkdownAnimateText: React.FC = ({ let lastIndex = 0; if (fullPatterns.length === 0) { - return [text]; - } + return [ + , + ]; + } // Use matchAll to find each match and its position for (const match of remainingText.matchAll(regex)) {