code: private ListItemBlock processFootnote(MacroMarkerBlock footnoteMacro, int counter,
          MacroTransformationContext context) throws MacroExecutionException
      {
          String content = footnoteMacro.getContent();
          if (StringUtils.isBlank(content)) {
              content = " ";
          }
          // Construct the footnote and reference blocks
          Block referenceBlock = createFootnoteReferenceBlock(counter);
          ListItemBlock footnoteBlock = createFootnoteBlock(content, counter, context);
          // Insert the footnote and the reference in the document.
          if (referenceBlock != null && footnoteBlock != null) {
              addFootnoteRef(footnoteMacro, referenceBlock);
              return footnoteBlock;
          }
          return null;
      }
docs: Processes a {{footnote}} macro, by generating a footnote element to insert in the footnote list and a reference
  to it, which is placed instead of the macro call.
  
  @param footnoteMacro the {{footnote}} macro element
  @param counter the current footnote counter
  @param context the execution context of the macro
  @return the footnote element which should be inserted in the footnote list
  @throws MacroExecutionException if the footnote content cannot be further processed