From 2018bb4de0d5eefb6e356e24139e622d440ee1b6 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Thu, 25 Apr 2019 19:40:00 +0200 Subject: [PATCH 1/3] Set exclude_pseudoclasses to False by default to have the same behaviour as the command line --- premailer/premailer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/premailer/premailer.py b/premailer/premailer.py index 4b21f2c..db6630e 100644 --- a/premailer/premailer.py +++ b/premailer/premailer.py @@ -140,7 +140,7 @@ def __init__( disable_link_rewrites=False, preserve_internal_links=False, preserve_inline_attachments=True, - exclude_pseudoclasses=True, + exclude_pseudoclasses=False, keep_style_tags=False, include_star_selectors=False, remove_classes=False, From 0c92e0eb1b08ee762dbf2b7ebfdb9464fa0e143a Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Thu, 25 Apr 2019 19:55:56 +0200 Subject: [PATCH 2/3] Set default value for --exclude-pseudoclasse to True --- README.rst | 2 +- premailer/__main__.py | 4 ++-- premailer/premailer.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 7f3afac..ad85364 100644 --- a/README.rst +++ b/README.rst @@ -155,7 +155,7 @@ module. --remove-internal-links PRESERVE_INTERNAL_LINKS Remove links that start with a '#' like anchors. --exclude-pseudoclasses - Pseudo classes like p:last-child', p:first-child, etc + Pseudo classes like p:last-child', p:first-child, :nth-child, etc --preserve-style-tags Do not delete tags from the html document. diff --git a/premailer/__main__.py b/premailer/__main__.py index 11c4bbd..6fd1791 100644 --- a/premailer/__main__.py +++ b/premailer/__main__.py @@ -49,8 +49,8 @@ def main(args): parser.add_argument( "--exclude-pseudoclasses", - default=False, - help="Pseudo classes like p:last-child', p:first-child, etc", + default=True, + help="Pseudo classes like p:last-child', p:first-child, :nth-child, etc", action="store_true", dest="exclude_pseudoclasses", ) diff --git a/premailer/premailer.py b/premailer/premailer.py index db6630e..4b21f2c 100644 --- a/premailer/premailer.py +++ b/premailer/premailer.py @@ -140,7 +140,7 @@ def __init__( disable_link_rewrites=False, preserve_internal_links=False, preserve_inline_attachments=True, - exclude_pseudoclasses=False, + exclude_pseudoclasses=True, keep_style_tags=False, include_star_selectors=False, remove_classes=False, From c59e71d9bf2db14a4430798e62e48eccb8769734 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Thu, 25 Apr 2019 20:05:16 +0200 Subject: [PATCH 3/3] Finally don't change the default --- premailer/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/premailer/__main__.py b/premailer/__main__.py index 6fd1791..7d32dfb 100644 --- a/premailer/__main__.py +++ b/premailer/__main__.py @@ -49,7 +49,7 @@ def main(args): parser.add_argument( "--exclude-pseudoclasses", - default=True, + default=False, help="Pseudo classes like p:last-child', p:first-child, :nth-child, etc", action="store_true", dest="exclude_pseudoclasses",