Support » Plugin: WP Minify » [Plugin: WP Minify] Ill-conceived line-wrapping of HTML for "human readability" remains

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m glad I’m not the only one whose still using version 1.0.4

    To the author of this plugin:

    regarding line 138 in HTML.php (version 1.1.8 of wpminify)

    code:

    // use newlines before 1st attribute in open tags (to limit line lengths)
    $this->_html = preg_replace(‘/(<[a-z\\-]+)\\s+([^>]+>)/i’, “$1\n$2”, $this->_html);

    Please can this be a feature that can be turned off by default in the settings page, or even removed entirely?

    I really do not know why anyone would want this feature, as it adds more characters to the HTML output.

    The reason I am wanting it removed is that enabling HTML minification breaks other plugin’s javascript, as javascript strings with line breaks will not work. More info : http://www.willmaster.com/blog/javascript/strings-line-breaks.php

    So if the javascript contains string literals with HTML code, then newline characters are being added. Example:

    This valid javascript:

    var html = 'Link';

    becomes

    var html = '<a
    href="#">Link';
    

    and is now not valid javascript.

    This is a major problem for plugin developers, because there is no way for us to get around this.

    Is it safe to just comment out the line in question?

    @chadrew: Yes!

    And consider it a mandatory thing to do when you get this plugin. There are other bugs we’ve discovered that may affect you which we addressed and fixed so feel free to read other comments for them if interested. But the one fix we all agree everyone should do is the one outlined in here. The other fixes may not be relevant to your site.

    And btw, this is by far the stupidest feature (adding new lines to prevent html from getting too long) i’ve ever seen.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: WP Minify] Ill-conceived line-wrapping of HTML for "human readability" remains’ is closed to new replies.