-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phone number URLs are broken #140
Comments
That |
I just found out that everything works fine if the number includes a proper international prefix (ie. starts with a Let's say we're using premailer to render HTML emails before sending them through an email service like Mailgun. If we want to add an unsubscribe link to our email, we have to insert a magic string like 0. <a href="foo/bar">I'm a regular link and work as intended.</a>
1. <a href="#foobar">I'm a relative link and work as intended.</a>
2. <a href="mailto:[email protected]">I'm an email link and work as intended.</a>
3. <a href="tel:+12345">I'm an international phone number link and work as intended.</a>
4. <a href="tel:12345">I'm a local phone number link and don't work with base_url.</a>
5. <a href="%unsubscribe_url%">I'm an unsubscribe link and don't work with base_url.</a>
6. <a href="{{template_variable}}">I'm a template variable link and don't work with base_url.</a> While malformed html = pm.Premailer(source, base_url=base, preserve_internal_links=True).transform()
html = html.replace("#%unsubscribe_url%", "%unsubscribe_url%") |
I think you have me convinced. There might not be an easy solution which we can hack around. |
Valid
tel:
urls are prepended with base_url when they shouldn't be. This is somehow related to #8.May I suggest adding an attribute that disables rewriting for a specific
<a>
tag? Maybe something like this:The text was updated successfully, but these errors were encountered: