fix: Use https for links without a scheme.

This commit is contained in:
Boris Grozev 2017-07-05 15:39:53 -05:00
parent b0eeb8a207
commit aee5a9ca43
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ export function linkify(inputText) {
//URLs starting with "www." (without // before it, or it'd re-link the ones done above).
replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank" rel="noopener noreferrer">$2</a>');
replacedText = replacedText.replace(replacePattern2, '$1<a href="https://$2" target="_blank" rel="noopener noreferrer">$2</a>');
//Change email addresses to mailto: links.
replacePattern3 = /(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim;