UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

12 lines (11 loc) 442 B
/** * Replace the parsed Markdown tree with a single paragraph containing the * original source as a plain text node. No Markdown formatting is interpreted. * React will escape it. */ export const remarkIgnoreMarkdown = () => (tree, file) => { const source = String(file.value ?? ''); const text = { type: 'text', value: source }; const paragraph = { children: [text], type: 'paragraph' }; tree.children = [paragraph]; };