public State parseState(CharSequence content) {
        boolean isDoubled = false;
        Matcher doubledMatcher = DOUBLED.matcher(content);
        if(doubledMatcher.matches()) {
            isDoubled = true;
            content = doubledMatcher.group(1);
        }

        Map<String, String> styles = new HashMap<String, String>();
        Matcher matcher = META.matcher(content);
        if (matcher.find()) {
            parseStyles(styles, matcher.group(2));
            content = matcher.replaceFirst("");
        }

        String[] parts = PARTS.split(content);
        State state = new State(parts[0], getOrNull(parts, 1));
        if(isDoubled) {
            state.markDoubled();
        }
        return state.usingStyles(styles);
    }