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
The chat message renderer uses marked.lexer to tokenize Markdown chat messages; in some cases, we reference the resulting token.text field to obtain just the text and render it inside an HTML tag. We then have our own rendering logic. However, as noted at markedjs/marked#1737, the lexer will encode HTML entities, rather than leaving that to the renderer. React applies its own encoding for dynamic content, which results in double-encoding.
For example, sending a code block (inside backticks) with an apostrophe inside the code will result in the user-visible message containing the HTML entity for apostrophe.
We can fix this by decoding the output of marked.lexer whenever it is used.
The text was updated successfully, but these errors were encountered:
The chat message renderer uses
marked.lexer
to tokenize Markdown chat messages; in some cases, we reference the resultingtoken.text
field to obtain just the text and render it inside an HTML tag. We then have our own rendering logic. However, as noted at markedjs/marked#1737, the lexer will encode HTML entities, rather than leaving that to the renderer. React applies its own encoding for dynamic content, which results in double-encoding.For example, sending a code block (inside backticks) with an apostrophe inside the code will result in the user-visible message containing the HTML entity for apostrophe.
We can fix this by decoding the output of
marked.lexer
whenever it is used.The text was updated successfully, but these errors were encountered: