code: @Override
    public List<Content> rewriteElement(@NotNull Element element) {
  
      // rewrite anchor elements
      if (StringUtils.equalsIgnoreCase(element.getName(), "a")) {
        return rewriteAnchor(element);
      }
  
      // rewrite image elements
      else if (StringUtils.equalsIgnoreCase(element.getName(), "img")) {
        return rewriteImage(element);
      }
  
      // detect BR elements and turn those into "self-closing" elements
      // since the otherwise generated <br> </br> structures are illegal and
      // are not handled correctly by Internet Explorers
      else if (StringUtils.equalsIgnoreCase(element.getName(), "br")) {
        if (element.getContent().size() > 0) {
          element.removeContent();
        }
        return null;
      }
  
      // detect empty elements and insert at least an empty string to avoid "self-closing" elements
      // that are not handled correctly by most browsers
      else if (NONSELFCLOSING_TAGS.contains(StringUtils.lowerCase(element.getName()))) {
        if (element.getContent().isEmpty()) {
          element.setText("");
        }
        return null;
      }
  
      return null;
    }
docs: Checks if the given element has to be rewritten.
  Is called for every child single element of the parent given to rewriteContent method.
  @param element Element to check
  @return null if nothing is to do with this element.
  Return empty list to remove this element.
  Return list with other content to replace element with new content.