docs: private void inlineImages(Document doc) {
          Elements allImages = doc.getElementsByTag(IMG_TAG);
          for (Element img : allImages) {
              if (img.attr(DATA_INLINE_ATTR).equals("true")) {
                  String src = img.attr(IMG_SRC_ATTR);
                  try {
                      URL url = new URL(src);
                      URLConnection urlConnection = url.openConnection();
                      urlConnection.connect();
                      String contentType = urlConnection.getContentType();
  
                      urlConnection.getContent();
                      byte[] srcContent = IOUtils.toByteArray(url.openStream());
                      String base64 = new Base64().encodeToString(srcContent);
  
                      img.attr(IMG_SRC_ATTR, MessageFormat.format("data:{0};base64,{1}", contentType, base64));
                  } catch (Exception e) {
                      LOG.log(Level.WARNING, null, e);
                  }
              }
          }
      }