diff --git a/premailer/premailer.py b/premailer/premailer.py index fc157ee..7cfb186 100644 --- a/premailer/premailer.py +++ b/premailer/premailer.py @@ -485,6 +485,8 @@ class Premailer(object): url.startswith('cid:') ): continue + if attr == 'href' and url.startswith('tel:'): + continue parent.attrib[attr] = urljoin(self.base_url, url) if hasattr(self.html, "getroottree"): diff --git a/premailer/tests/test_premailer.py b/premailer/tests/test_premailer.py index 5cdf6a7..dc7f2c1 100644 --- a/premailer/tests/test_premailer.py +++ b/premailer/tests/test_premailer.py @@ -837,6 +837,25 @@ ical-align:middle" bgcolor="red" valign="middle">Cell 2 compare_html(expect_html, result_html) + def test_tel_url(self): + """if you use URL with tel: protocol, it should stay as tel: + when baseurl is used + """ + + html = """ + + Title + + + 202-555-0113 + + """ + + p = Premailer(html, base_url='http://kungfupeople.com') + result_html = p.transform() + + compare_html(result_html, html) + def test_uppercase_margin(self): """Option to comply with outlook.com