milkshakesoftware/PreMailer.Net

Not all comments are removed

grokky1 opened this issue · 0 comments

When a comment is inside a tag then it is removed. As intended.

Problem1: When a comment is not inside a tag then it is not removed.
Problem2: When a comment is inside an ignored block then it is not removed.

Example:

<html>

    <head>

        /* PROBLEM1: this comment will not be removed */

        <style type="text/css">
            /* this comment will be removed */
            .foo { color:blue }
        </style>

        <style type="text/css" id="ignored">
            /* PROBLEM2: this comment will not be removed */
            .foo { color:green }
        </style>

    </head>

    <body>
        etc etc etc
    </body>

</html>

Conclusion 1: If removeComments: true then it should remove all comments.

Conclusion 2: It should also remove comments in a block ignored with ignoreElements: "#ignored".