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

Allow <s> on sanitize markdown #3646

Merged
merged 4 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -77,6 +77,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixes [#3561](https://github.com/microsoft/BotFramework-WebChat/issues/3561). Remove MyGet mentions from samples, by [@corinagum](https://github.com/corinagum) in PR [#3564](https://github.com/microsoft/BotFramework-WebChat/pull/3564)
- Fixes [#3537](https://github.com/microsoft/BotFramework-WebChat/issues/3537). Fix some carousels improperly using aria-roledescription, by [@corinagum](https://github.com/corinagum) in PR [#3599](https://github.com/microsoft/BotFramework-WebChat/pull/3599)
- Fixes [#3483](https://github.com/microsoft/BotFramework-WebChat/issues/3483). IE11 anchors fixed to open securely without 'noreferrer' or 'noopener', by [@corinagum](https://github.com/corinagum) in PR [#3607](https://github.com/microsoft/BotFramework-WebChat/pull/3607)
- Fixes [#3565](https://github.com/microsoft/BotFramework-WebChat/issues/3565). Allow strikethrough `<s>` on sanitize markdown, by [@corinagum](https://github.com/corinagum) in PR [#3646](https://github.com/microsoft/BotFramework-WebChat/pull/3646)

### Samples

Expand Down
5 changes: 5 additions & 0 deletions packages/bundle/src/__tests__/renderMarkdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,9 @@ describe('renderMarkdown', () => {
'<p><a href="tel:505-503-4455" target="_blank" rel="noopener noreferrer">(505)503-4455</a></p>\n'
);
});

it('should render strikethrough text correctly', () => {
const options = { markdownRespectCRLF: true };
expect(renderMarkdown(`~~strike text~~`, options)).toBe('<p><s>strike text</s></p>\n');
});
});
3 changes: 3 additions & 0 deletions packages/bundle/src/renderMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const SANITIZE_HTML_OPTIONS = {
'br',
'caption',
'code',
'del',
'div',
'em',
'h1',
Expand All @@ -29,11 +30,13 @@ const SANITIZE_HTML_OPTIONS = {
'hr',
'i',
'img',
'ins',
'li',
'nl',
'ol',
'p',
'pre',
's',
'span',
'strike',
'strong',
Expand Down