Skip to content

Commit 84e32c9

Browse files
beyackle2compulimbeyackleOEvgeny
authored
[Feature] Support HTML-in-Markdown (#5161)
* Added betterLinkDocumentMod * add markdownRenderHTML to styleOptions * Use new betterLinkDocumentMod and add a test * Fix asButton with aria-label and className * Update snapshots * Update entry * Use DOMParser + XMLSerializer * Revert red box * Update CHANGELOG.md * Update CHANGELOG.md Removes the redundant second changelog line * Add breaking changes * Run in JSDOM and remove empty "title" attribute * More explanation * Add HTML-in-Markdown for Adaptive Cards * Style HTML-in-Markdown for Adaptive Cards * Fix tests * Revert containerClassName * Move container to useRenderMarkdownAsHTML * Fix tests * Fix tests * Clean up * Add comment * Update entry * Fix tests * Added open in external icon * Add newline to end of XML serialization * Better test * Add HTML-in-Markdown --------- Co-authored-by: William Wong <[email protected]> Co-authored-by: Benjamin Yackley <[email protected]> Co-authored-by: Eugene Olonov <[email protected]>
1 parent 2b6e104 commit 84e32c9

File tree

58 files changed

+1377
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1377
-107
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3535
- Removed deprecated code: `connect*`, `useRenderActivity`, `useRenderActivityStatus`, `useRenderAvatar`, in PR [#5148](https://github.com/microsoft/BotFramework-WebChat/pull/5148), by [@compulim](https://github.com/compulim)
3636
- Added named exports in both CommonJS and ES Modules module format, in PR [#5148](https://github.com/microsoft/BotFramework-WebChat/pull/5148), by [@compulim](https://github.com/compulim)
3737
- Removed deprecated `useFocusSendBox()` hook, please use `useFocus('sendBox')` instead, in PR [#5150](https://github.com/microsoft/BotFramework-WebChat/pull/5150), by [@OEvgeny](https://github.com/OEvgeny)
38+
- HTML-in-Markdown is now supported. To disable this feature, set `styleOptions.markdownRenderHTML` to `false`
3839

3940
### Added
4041

@@ -65,6 +66,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6566
- Added `<ThemeProvider>` component to apply theme pack to Web Chat, by [@compulim](https://github.com/compulim), in PR [#5120](https://github.com/microsoft/BotFramework-WebChat/pull/5120)
6667
- Added `useMakeThumbnail` hook option to create a thumbnail from the file given, by [@compulim](https://github.com/compulim), in PR [#5123](https://github.com/microsoft/BotFramework-WebChat/pull/5123) and [#5122](https://github.com/microsoft/BotFramework-WebChat/pull/5122)
6768
- Added `moduleFormat` and `transpiler` build info to `<meta>` tag, in PR [#5148](https://github.com/microsoft/BotFramework-WebChat/pull/5148), by [@compulim](https://github.com/compulim)
69+
- Added support of rendering HTML-in-Markdown, in PR [#5161](https://github.com/microsoft/BotFramework-WebChat/pull/5161), by [@compulim](https://github.com/compulim), [@beyackle2](https://github.com/beyackle2), and [@OEvgeny](https://github.com/OEvgeny)
6870

6971
### Fixed
7072

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ export default function MyComponent() {
5454
}
5555
```
5656

57+
#### Support HTML-in-Markdown
58+
59+
Web Chat will now render HTML-in-Markdown. We have ported our sanitizer and accessibility fixer to work on HTML level. Both Markdown and HTML-in-Markdown will receive the same treatment and meet our security and accessibility requirements.
60+
61+
You can turn off this option by setting `styleOptions.markdownRenderHTML` to `false`.
62+
5763
### 4.16.1 notable changes
5864

5965
Web Chat now supports [Adaptive Cards schema up to 1.6](https://adaptivecards.io/explorer/). Some features in Adaptive Cards are in preview or designed to use outside of Bot Framework. Web Chat does not support these features.
274 Bytes
Loading
-95 Bytes
Loading
-95 Bytes
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)