Skip to content

Commit

Permalink
Added sip protocol to sanitize html options (#2061)
Browse files Browse the repository at this point in the history
* Added sip protocol

* Updated CHANGELOG.md

* insignificant change
  • Loading branch information
tdurnford authored and corinagum committed Jun 7, 2019
1 parent 616715a commit 0f0e12e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix [#1829](https://github.com/microsoft/BotFramework-WebChat/issues/1829). Fixed long text not being synthesized by Cognitive Services by bumping to [`react-say@1.2.0`](https://github.com/compulim/react-say), by [@compulim](https://github.com/compulim) in PR [#2035](https://github.com/Microsoft/BotFramework-WebChat/pull/2035)
- Fix [#1982](https://github.com/Microsoft/BotFramework-WebChat/issues/1982). Move to prettier! by [@corinagum](https://github.com/corinagum) in PR [#2038](https://github.com/Microsoft/BotFramework-WebChat/pull/2038)
- Fix [#1429](https://github.com/Microsoft/BotFramework-WebChat/issues/1429). Added markdown string preprocessing so the renderer will respect CRLF carriage returns (\r\n), by [@tdurnford](https://github.com/tdurnford) in PR [#2055](https://github.com/Microsoft/BotFramework-WebChat/pull/2055)
- 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)

## [4.4.1] - 2019-05-02

Expand Down
7 changes: 7 additions & 0 deletions packages/bundle/src/__tests__/renderMarkdown.spec.js
Expand Up @@ -54,4 +54,11 @@ describe('renderMarkdown', () => {
'<pre><code>{\n "hello": "World!"\n}\n</code></pre>\n'
);
});

it('should render sip protocol links correctly', () => {
const styleSet = { options: { markdownRespectCRLF: true } };
expect(renderMarkdown(`[example@test.com](sip:example@test.com)`, styleSet)).toBe(
'<p><a href="sip:example@test.com" target="_blank">example@test.com</a></p>\n'
);
});
});
1 change: 1 addition & 0 deletions packages/bundle/src/renderMarkdown.js
Expand Up @@ -9,6 +9,7 @@ const SANITIZE_HTML_OPTIONS = {
a: ['href', 'name', 'target', 'title'],
img: ['alt', 'src']
},
allowedSchemes: ['http', 'https', 'ftp', 'mailto', 'sip'],
allowedTags: [
'a',
'b',
Expand Down

0 comments on commit 0f0e12e

Please sign in to comment.