code: private boolean getAnchorLegacyMetadataFromSingleData(ValueMap resourceProps, Element element) {
      boolean foundAny = false;
  
      JSONObject metadata = null;
      Attribute dataAttribute = element.getAttribute("data");
      if (dataAttribute != null) {
        String metadataString = dataAttribute.getValue();
        if (StringUtils.isNotEmpty(metadataString)) {
          try {
            metadata = new JSONObject(metadataString);
          }
          catch (JSONException ex) {
            log.debug("Invalid link metadata: " + metadataString, ex);
          }
        }
      }
      if (metadata != null) {
        JSONArray names = metadata.names();
        for (int i = 0; i < names.length(); i++) {
          String name = names.optString(i);
          resourceProps.put(name, metadata.opt(name));
          foundAny = true;
        }
      }
  
      return foundAny;
    }
docs: Support legacy data structures where link metadata is stored as JSON fragment in single HTML5 data attribute.
  @param resourceProps ValueMap to write link metadata to
  @param element Link element