Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect processing before and after<nocompress> tag #56

Open
NicolasRoehm opened this issue Sep 25, 2020 · 1 comment
Open

Incorrect processing before and after<nocompress> tag #56

NicolasRoehm opened this issue Sep 25, 2020 · 1 comment
Assignees
Labels

Comments

@NicolasRoehm
Copy link

Hello Lars Moelleken,
Thank you for sharing this great library, it's very useful ! :)

What is this feature about (expected vs actual behaviour)?

HtmlMin doesn't work properly when using <nocompress></nocompress> tag.

How can I reproduce it?

use voku\helper\HtmlMin;

$html = "
<html>
  \r\n\t
  <body>
    <ul style=''>
      <li style='display: inline;' class='foo'>
        \xc3\xa0
      </li>
      <nocompress><!-- Protect me --></nocompress>
      <li class='foo' style='display: inline;'>
        \xc3\xa1
      </li>
      <!-- Remove me -->
    </ul>
  </body>
  \r\n\t
</html>
";
$htmlMin = new HtmlMin();

echo $htmlMin->minify($html);

This code returns

<html><body><ul><li style="display: inline;" class="foo">
            à
          </li>
          <nocompress><!-- Protect me --></nocompress>
          <li class="foo" style="display: inline;">
            á
          </li>
          <!-- Remove me --></ul>

Does it take minutes, hours or days to fix?

I don't know

Any additional information?

The code should return

<html><body><ul><li class=foo style="display: inline;"> à <!-- Protect me --><li class=foo style="display: inline;"> á </ul>

or at least

<html><body><ul><li class=foo style="display: inline;"> à <nocompress><!-- Protect me --></nocompress><li class=foo style="display: inline;"> á </ul>
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.84. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the bug label Sep 25, 2020
@voku voku self-assigned this Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants