GithubHelp home page GithubHelp logo

v3 unexpected whitespace removal about htmlmin HOT 8 CLOSED

Bilge avatar Bilge commented on May 27, 2024
v3 unexpected whitespace removal

from htmlmin.

Comments (8)

voku avatar voku commented on May 27, 2024

I think the problem is already fixed with version 3.0.0 (take a look at the tests -> https://travis-ci.org/voku/HtmlMin/builds/323025901), but you need to update "voku/simple_html_dom" >= 4.1.3. With version 3.0.1 we will now force this vendor update.

from htmlmin.

Bilge avatar Bilge commented on May 27, 2024

It seems I was using 4.1.3.

  - Removing voku/portable-utf8 (4.0.1)
  - Updating voku/simple_html_dom (4.0.1 => 4.1.3): Downloading (100%)
  - Updating voku/html-min (2.0.4 => 3.0.0): Downloading (100%)

from htmlmin.

voku avatar voku commented on May 27, 2024

Your example is added as unit-test and it is ok 👌 at Travis CI (php 7.0 - 7.2) and also on my local system (Ubuntu + php 7.0.x).

If it's still a problem for you, maybe you can detect your current libxml2 version? Because this library is used by php for dom interactions.

from htmlmin.

Bilge avatar Bilge commented on May 27, 2024

Whitespace before anchors are definitely being removed.

Before

<span>foo</span>                                         <span>bar</span>                                                                                                                         <a>baz</a>                                                                                 <a>bat</a>

After

<span>foo</span> <span>bar</span><a>baz</a><a>bat</a>

Note that the foo span is needed for the space to be deleted before the baz tag. Maybe the presence of this extra tag is breaking some special-casing code. Since there is whitespace before each of the <a> tags in the source there should still be a single whitespace before each of the output tags.

Using

  • voku/html-min: 3.0.1
  • voku/simple_html_dom: 4.1.3

from htmlmin.

Bilge avatar Bilge commented on May 27, 2024

Why closed?

from htmlmin.

voku avatar voku commented on May 27, 2024

I added tests (28 Jan) that passed on travis-ci and on my local laptop, so I can't fix a test that did not fail :/ ... or did I miss something in the test?!

from htmlmin.

Bilge avatar Bilge commented on May 27, 2024

from htmlmin.

jordanade avatar jordanade commented on May 27, 2024

I'm still experiencing this issue!

from htmlmin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.