docs: private void extractStyles(Document doc) {
          String stylesheet = fetchStyles(doc);
  
          String trimmedStylesheet = stylesheet.replaceAll("\n", "").replaceAll("/\\*.*?\\*/", "").replaceAll(" +", " ");
          String styleRules = trimmedStylesheet.trim(), delims = "{}";
          StringTokenizer st = new StringTokenizer(styleRules, delims);
          while (st.countTokens() > 1) {
              String selector = st.nextToken(), properties = st.nextToken();
              Elements selectedElements = doc.select(selector);
              for (Element selElem : selectedElements) {
                  String oldProperties = selElem.attr(CSS_STYLE);
                  selElem.attr(CSS_STYLE,
                          oldProperties.length() > 0 ? concatenateProperties(
                                          oldProperties, properties) : properties);
              }
          }
      }