Conversation
Don't prepend base_url to URLs if the tag's attribute 'data-premailer' is set to 'ignore'
|
You have me convinced in the Issue that we need to tackle this with an option. However, the PR needs some work. I don't like that the ...and giving someone sets which is NOT want we want. We just want the Do you have some other ideas about how to annotate and tell premailer to "not touch" an attribute value? |
|
How about this for a functional idea: def my_replacer(value, base_url):
if 'tel:' in value:
# leave it as is
return value
return urlparse.urljoin(base_url, value)
premailer.transform(html, base_url='http://example.com', base_url_replacer=my_replacer) |
|
So the problem is that it becomes |
Don't prepend base_url to URLs if the tag's attribute 'data-premailer' is set to 'ignore'. Helps with / fixes #140.