diff --git a/emark/message.py b/emark/message.py index b08f7a6..fac24b6 100644 --- a/emark/message.py +++ b/emark/message.py @@ -131,7 +131,7 @@ def inject_utm_params(self, md, **utm): for url in INLINE_LINK_RE.findall(md): try: url_parts = parse.urlparse(url) - if url_parts.scheme not in [ + if url_parts.scheme.lower() not in [ "http", "https", "", @@ -143,7 +143,7 @@ def inject_utm_params(self, md, **utm): for url in INLINE_HTML_LINK_RE.findall(md): try: url_parts = parse.urlparse(url) - if url_parts.scheme not in [ + if url_parts.scheme.lower() not in [ "http", "https", "", diff --git a/tests/test_message.py b/tests/test_message.py index 6853250..1d4a308 100644 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -280,6 +280,10 @@ def test_inject_utm_params(self): "A link without www " in email_message.body ) + assert ( + "ALL CAPS LINK " + in email_message.body + ) assert ( "localhost:8000 " in email_message.body diff --git a/tests/testapp/templates/template.md b/tests/testapp/templates/template.md index c597367..4914d0a 100644 --- a/tests/testapp/templates/template.md +++ b/tests/testapp/templates/template.md @@ -13,6 +13,7 @@ Vanilla lollipop biscuit cake marzipan jelly. [A link with parameter](https://www.example.com/?foo=bar) [A link without a scheme](www.example.com) [A link without www](example.com) +[ALL CAPS LINK](HTTP://WWW.EXAMPLE.COM) [localhost:8000](http://localhost:8000) [555-2368](tel:5552368)