stream-chat-react 13.6.5 → 13.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,12 @@
1
1
  import React from 'react';
2
2
  import ReactMarkdown from 'react-markdown';
3
- export const renderPreviewText = (text) => (React.createElement(ReactMarkdown, { skipHtml: true }, text));
3
+ import { htmlToTextPlugin } from '../Message';
4
+ import remarkGfm from 'remark-gfm';
5
+ const remarkPlugins = [
6
+ htmlToTextPlugin,
7
+ [remarkGfm, { singleTilde: false }],
8
+ ];
9
+ export const renderPreviewText = (text) => (React.createElement(ReactMarkdown, { remarkPlugins: remarkPlugins, skipHtml: true }, text));
4
10
  const getLatestPollVote = (latestVotesByOption) => {
5
11
  let latestVote;
6
12
  for (const optionVotes of Object.values(latestVotesByOption)) {
@@ -24,7 +24,7 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
24
24
  useEffect(() => {
25
25
  if (!client)
26
26
  return;
27
- const version = "13.6.5";
27
+ const version = "13.6.6";
28
28
  const userAgent = client.getUserAgent();
29
29
  if (!userAgent.includes('stream-chat-react')) {
30
30
  // result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'
@@ -32,6 +32,12 @@ export const defaultAllowedTagNames = [
32
32
  // custom types (tagNames)
33
33
  'emoji',
34
34
  'mention',
35
+ 'h1',
36
+ 'h2',
37
+ 'h3',
38
+ 'h4',
39
+ 'h5',
40
+ 'h6',
35
41
  ];
36
42
  function formatUrlForDisplay(url) {
37
43
  try {