You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docusaurus/docs/React/components/core-components/message-list.mdx
+73-36Lines changed: 73 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,42 +122,6 @@ const App = () => (
122
122
);
123
123
```
124
124
125
-
#### Custom element rendering
126
-
127
-
If you feel like the default output is sufficient, but you'd like to adjust how certain [ReactMarkdown components](https://github.com/remarkjs/react-markdown#appendix-b-components) look like (like `strong` element generated by typing \*\*strong\*\*) you can do so by passing down options to a third argument of the default `renderText` function:
128
-
129
-
:::note
130
-
Types `mention` and `emoji` are special case component types generated by our SDK's custom rehype plugins.
131
-
:::
132
-
133
-
```tsx
134
-
import { renderText } from'stream-chat-react';
135
-
136
-
const StrongComponent = ({ children }) => <bclassName='custom-strong-class-name'>{children}</b>;
If you would like to extend the array of plugins used to parse the markdown, you can provide your own lists of remark resp. rehype plugins. The logic that determines what plugins are used and in which order can be specified in custom `getRehypePlugins` and `getRemarkPlugins` functions. These receive the default array of rehype and remark plugins for further customization. Both custom functions ought to be passed to the third `renderText()` parameter. An example follows:
The SDK provides the following plugins that are not applied to the text parsing by the default `renderText()` implementation. However, these can be included by simply overriding the defaults with `getRemarkPlugins` and `getRehypePlugins` parameters as described in [the section about custom plugins](#custom-remark-and-rehype-plugins).
188
+
189
+
Currently, there are the following optional remark plugins available in the SDK:
190
+
191
+
-`htmlToTextPlugin` - keeps the HTML tags in the resulting text string.
192
+
-`keepLineBreaksPlugin` - replaces empty lines in text with line breaks ([according to the CommonMark Markdown specification](https://spec.commonmark.org/0.30/#hard-line-breaks), the empty lines - meaning newline characters `\n` - are not transformed to `<br/>` elements).
If you feel like the default output is sufficient, but you'd like to adjust how certain [ReactMarkdown components](https://github.com/remarkjs/react-markdown#appendix-b-components) look like (like `strong` element generated by typing \*\*strong\*\*) you can do so by passing down options to a third argument of the default `renderText` function:
225
+
226
+
:::note
227
+
Types `mention` and `emoji` are special case component types generated by our SDK's custom rehype plugins.
228
+
:::
229
+
230
+
```tsx
231
+
import { renderText } from'stream-chat-react';
232
+
233
+
const StrongComponent = ({ children }) => <bclassName='custom-strong-class-name'>{children}</b>;
0 commit comments