src/main/java/j2html/utils/CSSMin.java
private ArrayList<Property> parseProperties(String contents) {
        ArrayList<String> parts = new ArrayList<>();
        boolean bInsideString = false,
            bInsideURL = false;
        int j = 0;
        String substr;
        for (int i = 0; i < contents.length(); i++) {
            if (bInsideString) { // If we're inside a string
                bInsideString = !(contents.charAt(i) == '"');
            } else if (bInsideURL) { // If we're inside a URL
                bInsideURL = !(contents.charAt(i) == ')');
            } else if (contents.charAt(i) == '"') {
                bInsideString = true;
            } else if (contents.charAt(i) == '(') {
                if ((i - 3) > 0 && "url".equals(contents.substring(i - 3, i))) {
                    bInsideURL = true;
                }
            } else if (contents.charAt(i) == ';') {
                substr = contents.substring(j, i);
                if (!(substr.trim().equals(""))) {
                    parts.add(substr);
                }
                j = i + 1;
            }
        }
        substr = contents.substring(j, contents.length());
        if (!(substr.trim().equals(""))) {
            parts.add(substr);
        }

        ArrayList<Property> results = new ArrayList<>();
        for (String part : parts) {
            try {
                results.add(new Property(part));
            } catch (IncompletePropertyException ipex) {
                LOG.warning("Incomplete property in selector \"" + this.selector + "\": \"" + ipex.getMessage() + "\"");
            }
        }

        return results;
    }
private ArrayList<Property> parseProperties(String contents) {
        ArrayList<String> parts = new ArrayList<>();
        boolean bInsideString = false,
            bInsideURL = false;
        int j = 0;
        String substr;
        for (int i = 0; i < contents.length(); i++) {
            if (bInsideString) { // If we're inside a string
                bInsideString = !(contents.charAt(i) == '"');
            } else if (bInsideURL) { // If we're inside a URL
                bInsideURL = !(contents.charAt(i) == ')');
            } else if (contents.charAt(i) == '"') {
                bInsideString = true;
            } else if (contents.charAt(i) == '(') {
                if ((i - 3) > 0 && "url".equals(contents.substring(i - 3, i))) {
                    bInsideURL = true;
                }
            } else if (contents.charAt(i) == ';') {
                substr = contents.substring(j, i);
                if (!(substr.trim().equals(""))) {
                    parts.add(substr);
                }
                j = i + 1;
            }
        }
        substr = contents.substring(j, contents.length());
        if (!(substr.trim().equals(""))) {
            parts.add(substr);
        }

        ArrayList<Property> results = new ArrayList<>();
        for (String part : parts) {
            try {
                results.add(new Property(part));
            } catch (IncompletePropertyException ipex) {
                LOG.warning("Incomplete property in selector \"" + this.selector + "\": \"" + ipex.getMessage() + "\"");
            }
        }

        return results;
    }
private ArrayList < Property > parseProperties ( String contents ) { ArrayList < String > parts = new ArrayList <> ( ) ; boolean bInsideString = false , bInsideURL = false ; int j = 0 ; String substr ; for ( int i = 0 ; i < contents . length ( ) ; i ++ ) { if ( bInsideString ) { // If we're inside a string bInsideString = ! ( contents . charAt ( i ) == ' ' ) ; } else if ( bInsideURL ) { // If we're inside a URL bInsideURL = ! ( contents . charAt ( i ) == ' ' ) ; } else if ( contents . charAt ( i ) == ' ' ) { bInsideString = true ; } else if ( contents . charAt ( i ) == ' ' ) { if ( ( i - 3 ) > 0 && "url" . equals ( contents . substring ( i - 3 , i ) ) ) { bInsideURL = true ; } } else if ( contents . charAt ( i ) == ' ' ) { substr = contents . substring ( j , i ) ; if ( ! ( substr . trim ( ) . equals ( "" ) ) ) { parts . add ( substr ) ; } j = i + 1 ; } } substr = contents . substring ( j , contents . length ( ) ) ; if ( ! ( substr . trim ( ) . equals ( "" ) ) ) { parts . add ( substr ) ; } ArrayList < Property > results = new ArrayList <> ( ) ; for ( String part : parts ) { try { results . add ( new Property ( part ) ) ; } catch ( IncompletePropertyException ipex ) { LOG . warning ( "Incomplete property in selector \"" + this . selector + "\": \"" + ipex . getMessage ( ) + "\"" ) ; } } return results ; }
Parses out the properties of a selector's body.

@param contents The body; for example, "border: solid 1px red; color: blue;"
@return An array of properties parsed from this selector.
Parses out the properties of a selector s body .