From 44cfa8f469cdedce58c4e1a773f46867e888461d Mon Sep 17 00:00:00 2001 From: Bojan Mojsilovic Date: Fri, 12 Jan 2024 16:38:01 +0100 Subject: [PATCH] Fix revert gt & lt html codes into proper charaters --- src/components/ParsedNote/ParsedNote.tsx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/ParsedNote/ParsedNote.tsx b/src/components/ParsedNote/ParsedNote.tsx index bf823c5..b4b06fe 100644 --- a/src/components/ParsedNote/ParsedNote.tsx +++ b/src/components/ParsedNote/ParsedNote.tsx @@ -372,15 +372,21 @@ const ParsedNote: Component<{ }; const renderText = (item: NoteContent) => { - return - {token => { - if (isNoteTooLong()) return; - if (token.trim().length > 0) { - setWordsDisplayed(w => w + 1); - } - return token - }} - ; + let tokens = []; + + for (let i=0;i 0) { + setWordsDisplayed(w => w + 1); + } + tokens.push(token) + } + + const text = tokens.join(' ').replaceAll('<', '<').replaceAll('>', '>'); + + return <>{text}; }; const renderImage = (item: NoteContent) => {