Skip to content

Commit 05510e1

Browse files
committed
Preprocess: Enhance premailer to allow not to touch any URLs
1 parent 4434b36 commit 05510e1

2 files changed

Lines changed: 117 additions & 116 deletions

File tree

commands/preprocess_cssless.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# You should have received a copy of the GNU General Public License
1616
# along with this program. If not, see http://www.gnu.org/licenses/.
1717

18-
from premailer import transform
18+
from premailer import Premailer
1919
import cssutils
2020
import logging
2121
import os
@@ -36,7 +36,8 @@ def preprocess_html_merge_css(src_path, dst_path):
3636

3737
with warnings.catch_warnings():
3838
warnings.simplefilter("ignore")
39-
content = transform(content, base_url=src_path)
39+
premailer = Premailer(content, base_url=src_path, preserve_all_links=True)
40+
content = premailer.transform()
4041

4142
head = os.path.dirname(dst_path)
4243
os.makedirs(head, exist_ok=True)

0 commit comments

Comments
 (0)