Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
HtmlConversion: Add support for telephone links (#2365)
Browse files Browse the repository at this point in the history
Summary:
- This will allow html anchor tags with "tel:" prefixed hrefs to be rendered as links using the convertFromHTML method

*Before* submitting a pull request, please make sure the following is done...

1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests!
3. If you've changed APIs, update the documentation.
4. Ensure that:
  * The test suite passes (`npm test`)
  * Your code lints (`npm run lint`) and passes Flow (`npm run flow`)
  * You have followed the [testing guidelines](https://github.com/facebook/draft-js/wiki/Testing-for-Pull-Requests)
5. If you haven't already, complete the [CLA](https://code.facebook.com/cla).

Please use the simple form below as a guideline for describing your pull request.

Thanks for contributing to Draft.js!

-

**Summary**

[...]

**Test Plan**

[...]
Pull Request resolved: #2365

Reviewed By: creedarky

Differential Revision: D21318447

Pulled By: mrkev

fbshipit-source-id: d352eb7c731724dfe80e6c86a882f7b59ac88520
  • Loading branch information
alauriaYext authored and facebook-github-bot committed Apr 30, 2020
1 parent d1cb1e7 commit e1e9a0c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/model/encoding/convertFromHTMLToContentBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ const isValidAnchor = (node: Node) => {
anchorNode.href &&
(anchorNode.protocol === 'http:' ||
anchorNode.protocol === 'https:' ||
anchorNode.protocol === 'mailto:')
anchorNode.protocol === 'mailto:' ||
anchorNode.protocol === 'tel:')
);
};

Expand Down

0 comments on commit e1e9a0c

Please sign in to comment.