I'd like to add renderMarkdown using the React component in the Bot framework. I am able to add through HTML like below and it's working as expected but my requirement is to add the same feature using the react.
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<script src="https://www.acai-hub.com/js/markdown-it.min-8.4.2.js"></script>
<style>
html,
body {
height: 100%;
}
body {
margin: 0;
}
#webchat {
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div id="webchat" role="main"></div>
<script>
const markdownIt = window.markdownit({ html: true, linkify: true, typographer: true });
const renderMarkdown = text => markdownIt.render(text);
window.WebChat.renderWebChat(
{
directLine: window.WebChat.createDirectLine({
token: 'VeY8HxuBVIw.fKAVwOjeVn9tcx7fhZ0cSCBz5vM8tp8G0JcNT3BGiRI'
}),
userID: 'Arun',
username: 'Arun',
locale: 'en-US',
botAvatarInitials: 'WC',
userAvatarInitials: 'WW',
renderMarkdown: renderMarkdown
},
document.getElementById('webchat')
);
</script>
</body>
</html>
Does anybody know how to add renderMarkdown using middleware since I am new to the react?