Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed markdown renderer in Playground #2073

Merged
merged 6 commits into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix [#2057](https://github.com/Microsoft/BotFramework-WebChat/issues/2057). Added sip protocol to sanitize HTML options, by [@tdurnford](https://github.com/tdurnford) in PR [#2061](https://github.com/Microsoft/BotFramework-WebChat/pull/2061)
- Fix [#2062](https://github.com/Microsoft/BotFramework-WebChat/issues/2062). Fixed markdown rendering issue in cards, by [@tdurnford](https://github.com/tdurnford) in PR [#2063](https://github.com/Microsoft/BotFramework-WebChat/pull/2063)
- Fix [#1896](https://github.com/microsoft/BotFramework-WebChat/issues/1896). Added data schema to render base64 images, by [@denscollo](https://github.com/denscollo) in PR[#2067](https://github.com/microsoft/BotFramework-WebChat/pull/2067)
- Fix [#2069](https://github.com/microsoft/BotFramework-WebChat/issues/2069). Fixed markdown renderer issue in Playground, by [@tdurnford](https://github.com/tdurnford) in PR[#2073](https://github.com/microsoft/BotFramework-WebChat/pull/2073)

## [4.4.1] - 2019-05-02

Expand Down
14 changes: 11 additions & 3 deletions packages/bundle/src/FullReactWebChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React from 'react';
import createAdaptiveCardsAttachmentMiddleware from './adaptiveCards/createAdaptiveCardMiddleware';
import createStyleSet from './adaptiveCards/Styles/createStyleSetWithAdaptiveCards';
import defaultAdaptiveCardHostConfig from './adaptiveCards/Styles/adaptiveCardHostConfig';
import renderMarkdown from './renderMarkdown';
import defaultRenderMarkdown from './renderMarkdown';

// Add additional props to <WebChat>, so it support additional features
class FullReactWebChat extends React.Component {
Expand All @@ -31,10 +31,18 @@ class FullReactWebChat extends React.Component {
}

render() {
const { adaptiveCardHostConfig, attachmentMiddleware, styleOptions, styleSet, ...otherProps } = this.props;
const {
adaptiveCardHostConfig,
attachmentMiddleware,
styleOptions,
styleSet,
renderMarkdown,
tdurnford marked this conversation as resolved.
Show resolved Hide resolved
...otherProps
} = this.props;

const memoizedStyleSet = this.memoizeStyleSet(styleSet, styleOptions);
const memoizedRenderMarkdown = this.memoizeRenderMarkdown(renderMarkdown, memoizedStyleSet);
const memoizedRenderMarkdown =
renderMarkdown || this.memoizeRenderMarkdown(defaultRenderMarkdown, memoizedStyleSet.options.markdown);
tdurnford marked this conversation as resolved.
Show resolved Hide resolved

return (
<BasicWebChat
Expand Down
4 changes: 1 addition & 3 deletions packages/playground/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import memoize from 'memoize-one';
import ReactWebChat, {
createBrowserWebSpeechPonyfillFactory,
createCognitiveServicesBingSpeechPonyfillFactory,
createCognitiveServicesSpeechServicesPonyfillFactory,
renderMarkdown
createCognitiveServicesSpeechServicesPonyfillFactory
} from 'botframework-webchat';

import createDevModeActivityMiddleware from './createDevModeActivityMiddleware';
Expand Down Expand Up @@ -281,7 +280,6 @@ export default class extends React.Component {
directLine={directLine}
disabled={disabled}
locale={language}
renderMarkdown={renderMarkdown}
sendTimeout={+sendTimeout || undefined}
sendTypingIndicator={sendTypingIndicator}
store={store}
Expand Down