Skip to content

Commit

Permalink
feat: markdown parsing for user messages too
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Nov 25, 2024
1 parent 720ff84 commit 34f991d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/ChatBubble/ChatBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const ChatBubble: React.FC<Props> = ({
return text;
}
};
const renderedText = message.fromUser ? text : renderMsg(text);
const renderedText = renderMsg(text);

const plainText = message.fromUser
? text
Expand Down
24 changes: 18 additions & 6 deletions src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ exports[`renders ChatBubble from user with avatar as react element unchanged 1`]
class="memori-chat--bubble-content"
dir="auto"
>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
<p>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
</p>
</div>
</div>
<div
Expand All @@ -38,7 +40,9 @@ exports[`renders ChatBubble from user with avatar unchanged 1`] = `
class="memori-chat--bubble-content"
dir="auto"
>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
<p>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
</p>
</div>
</div>
<picture
Expand Down Expand Up @@ -66,7 +70,9 @@ exports[`renders ChatBubble from user with custom avatar unchanged 1`] = `
class="memori-chat--bubble-content"
dir="auto"
>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
<p>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
</p>
</div>
</div>
<picture
Expand Down Expand Up @@ -4174,7 +4180,9 @@ exports[`renders ChatBubble with msg from BoE expert unchanged 1`] = `
class="memori-chat--bubble-content"
dir="auto"
>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
<p>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
</p>
</div>
<div
class="memori-chat--bubble-addon"
Expand Down Expand Up @@ -4257,7 +4265,9 @@ exports[`renders ChatBubble with msg generated by AI unchanged 1`] = `
class="memori-chat--bubble-content"
dir="auto"
>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
<p>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
</p>
</div>
<div
class="memori-chat--bubble-addon"
Expand Down Expand Up @@ -4472,7 +4482,9 @@ exports[`renders ChatBubble with user msg unchanged 1`] = `
class="memori-chat--bubble-content"
dir="auto"
>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
<p>
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
</p>
</div>
</div>
<div
Expand Down

0 comments on commit 34f991d

Please sign in to comment.