We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d92e0d1 commit 33a7bbfCopy full SHA for 33a7bbf
packages/cozy-search/src/components/Conversations/ChatItemLabel.jsx
@@ -10,14 +10,17 @@ import Markdown from 'cozy-ui/transpiled/react/Markdown'
10
* @returns {string} sanitized content
11
*/
12
const sanitizeContent = content => {
13
+ if (!content) {
14
+ return ''
15
+ }
16
return content
17
.replace(/\s?\[REF\][\s\S]*?\[\/REF\]/g, '')
18
.replace(/\s?\[doc_\d+\]/g, '')
19
}
20
21
const ChatItemLabel = ({ label }) => {
- const content = sanitizeContent(label)
22
if (typeof label === 'string') {
23
+ const content = sanitizeContent(label)
24
return <Markdown content={content} />
25
26
0 commit comments