Skip to content

Unable to compress html conditional statements #76

@mboron83

Description

@mboron83

I have a problem with compressing html with conditional statements included.

Input:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<!--[if IE]>
<h1>Hello World</h1>
<![endif]-->
</body>
</html>

Expected output:

<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><!--[if IE]><h1>Hello World</h1><![endif]--></body></html>

Actual output:

<html><head> <body> <!--[if IE]>
<h1>Hello World</h1>
<![endif]-->

As you can see - some tags after conditional statement are completely omitted
Library is installed with composer

composer require wyrihaximus/html-compress 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions