tipsy / j2html

Java to HTML generator. Enjoy typesafe HTML generation.

Home Page:https://j2html.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Config.cssMinifier.minify strips last character from each selector

ylexus opened this issue · comments

j2html 1.2.0. To reproduce, run this:

        System.out.println(Config.cssMinifier.minify("body {\n" +
                "    font-family: verdana, geneva, sans-serif;\n" +
                "    font-size: 90%\n" +
                "}\n" +
                "table {\n" +
                "    border: 1px solid black;\n" +
                "    border-collapse: collapse;\n" +
                "    font-size: 90%\n" +
                "}\n" +
                "th {\n" +
                "    text-align: left\n" +
                "}\n" +
                "th,td {\n" +
                "    vertical-align: text-top\n" +
                "}\n" +
                "td.unresolved {\n" +
                "    color: red\n" +
                "}\n" +
                "td.resolved {\n" +
                "    color: green\n" +
                "}\n" +
                "th, td {\n" +
                "    padding: 0.2em;\n" +
                "    text-align: left\n" +
                "}\n" +
                "td.odd, th.odd {\n" +
                "    background-color: #f2f2f2\n" +
                "}"));

which yields in
body{font-family:verdana,geneva,sans-serif;font-size:90}table{border:1px solid black;border-collapse:collapse;font-size:90}th{text-align:lef}th,td{vertical-align:text-to}td.unresolved{color:re}td.resolved{color:gree}th,td{padding:0.2em;text-align:lef}td.odd,th.odd{background-color:#f2f2f}

Note last character of each selector is trimmed.

commented

@ylexus I guess the minifier assumes there is a semi-colon there.

commented

Seems it's an issue with CSSMin: barryvan/CSSMin#20

commented

body{font-family:verdana,geneva,sans-serif;font-size:90%}table{border:1px solid black;border-collapse:collapse;font-size:90%}th{text-align:left}th,td{vertical-align:text-top}td.unresolved{color:red}td.resolved{color:green}th,td{padding:0.2em;text-align:left}td.odd,th.odd{background-color:#f2f2f2}

commented

Fixed in 4288924

commented

Released as part of 1.2.1

<dependency>
    <groupId>com.j2html</groupId>
    <artifactId>j2html</artifactId>
    <version>1.2.1</version>
</dependency>

http://search.maven.org/#artifactdetails%7Ccom.j2html%7Cj2html%7C1.2.1%7Cjar