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
* 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]>
Copy file name to clipboardexpand all lines: CHANGELOG.md
+2
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
35
35
- Removed deprecated code: `connect*`, `useRenderActivity`, `useRenderActivityStatus`, `useRenderAvatar`, in PR [#5148](https://github.com/microsoft/BotFramework-WebChat/pull/5148), by [@compulim](https://github.com/compulim)
36
36
- 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)
37
37
- 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`
38
39
39
40
### Added
40
41
@@ -65,6 +66,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
65
66
- 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)
66
67
- 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)
67
68
- 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)
Copy file name to clipboardexpand all lines: README.md
+6
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,12 @@ export default function MyComponent() {
54
54
}
55
55
```
56
56
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
+
57
63
### 4.16.1 notable changes
58
64
59
65
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.
test('renderMarkdown should add accessibility text for external links',async()=>{
39
51
const{ pageObjects }=awaitsetupWebDriver();
40
52
41
-
awaitexpect(
42
-
pageObjects.runHook('useRenderMarkdownAsHTML',[],fn=>fn('Click [here](https://aka.ms/) to find out more.'))
43
-
).resolves.toMatchInlineSnapshot(`
44
-
"<p>Click \u200B<a href=\\"https://aka.ms/\\" aria-label=\\"here Opens in a new window; external.\\" rel=\\"noopener noreferrer\\" target=\\"_blank\\">here<img src=\\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\\" alt class=\\"webchat__render-markdown__external-link-icon\\" title=\\"Opens in a new window; external.\\" /></a>\u200B to find out more.</p>
`<div xmlns="http://www.w3.org/1999/xhtml" class="webchat__render-markdown webchat__render-markdown--message-activity webchat--css-xxxxx-xxxxx"><p>Click \u200B<a href="https://aka.ms/" aria-label="here Opens in a new window; external." rel="noopener noreferrer" target="_blank">here<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="" class="webchat__render-markdown__external-link-icon" title="Opens in a new window; external." /></a>\u200B to find out more.</p></div>\n`
61
+
);
47
62
});
48
63
49
64
test('renderMarkdown should add accessibility text for external links with yue',async()=>{
const{ directLine, store }=testHelpers.createDirectLineEmulator();
14
+
15
+
WebChat.renderWebChat({ directLine, store },document.getElementById('webchat'));
16
+
17
+
awaitpageConditions.uiConnected();
18
+
19
+
awaitdirectLine.emulateIncomingActivity({
20
+
entities: [
21
+
{
22
+
'@context': 'https://schema.org',
23
+
'@id': '',
24
+
'@type': 'Message',
25
+
citation: [
26
+
{
27
+
'@type': 'Claim',
28
+
appearance: {
29
+
'@type': 'DigitalDocument',
30
+
url: 'https://example.com/1/',
31
+
usageInfo: {
32
+
'@id': '_:1',
33
+
'@type': 'CreativeWork',
34
+
description:
35
+
'Nisi quis ut sint elit est nulla enim eiusmod. Deserunt commodo pariatur nostrud culpa aliquip esse pariatur exercitation nulla do proident. Est qui eiusmod aliquip deserunt labore consequat fugiat. Ullamco reprehenderit nostrud eiusmod nisi nulla esse id. Reprehenderit aliqua quis consectetur sit cupidatat fugiat Lorem ex labore. Eiusmod velit laborum quis tempor incididunt excepteur culpa esse nulla.',
36
+
keywords: ['encrypted-content'],
37
+
name: 'Sit veniam do irure velit est et quis ut Lorem reprehenderit commodo cillum occaecat',
text: 'Incididunt amet dolore anim commodo fugiat occaecat elit nulla do consequat. Quis incididunt occaecat labore adipisicing. Cillum sunt velit consequat irure ipsum ullamco sint ea aute. Sunt et eu ut enim aliqua cupidatat non adipisicing dolore commodo dolor magna enim. Commodo reprehenderit excepteur ad nostrud ex id aliquip deserunt eiusmod. Esse non labore nulla voluptate.',
text: 'Ipsum[1] dolore[2] cupidatat[3] magna[4] consectetur[5] do tempor est excepteur.\n\n[1]: https://example.com/1/ "Sint amet id officia dolor ex eiusmod ipsum ipsum magna fugiat"\n[2]: https://example.com/2/ "Laboris cupidatat voluptate"\n[3]: _:3 "Velit nulla culpa eu ea consectetur consectetur dolore velit"\n[4]: _:4 "Adipisicing enim nulla"\n[5]: https://example.com/5',
0 commit comments