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
I'm not exactly sure how the Playground is using the markdown renderer, but the renderMarkdown function takes a second parameter - styleSet - that is deconstructed to access the markdownRespectCRLF value in Web Chat's style options. Perhaps we shouldn't deconstruct the styleSet in the function declaration and check for the options existence in an if statement instead.
renderMarkdown should be as simple as (markdown: string) => string, without options.
And people who send in renderMarkdown, e.g. FullReactWebChat, should be responsible to configure the Markdown engine.
The current code in FullReactWebChat is good (i.e. memoizedRenderMarkdown part) because it configure the Markdown engine and send in a function (markdown: string) => string.
We prefer simple interface for renderMarkdown because it would be easily adaptable to other engines without looking into our code.
Right, so the markdown renderer being passed to ReactWebChat needs to be of type (markdown: string) => string, but the type of the markdwon renderer being exported by botframework-webchat is of type (markdown: string, options: any) => string. It looks like the Playground is importing the renderer from botframework-webchat and then passing it to ReactWebChat causing the type mismatch. This seems like a redundant step since the renderer is configured in FullReactWebChat by default.
Should we reconfigure the render function that botframework-webchat is exporting, remove the renderMarkdown prop passed to ReactWebChat in the Playground, or both?
Screenshots
Version
"master"
Describe the bug
Playground throw exception after trying to connect to Mockbot.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
User can start talking to Mockbot.
Additional context
Seems related to recent CRLF changes on renderMarkdown.
[Bug]
The text was updated successfully, but these errors were encountered: