 
   # Process footnotes and and links.
   if options.footnotes
-    mapping = defineFootnoteNumber(root)
+    mapping = defineFootnoteNumber(root).mapping
     applyFootnoteNumber(root, mapping)
   defs = removeDefinitions(root)
   if options.footnotes


# Sets `footnoteNumber` property to every footnote reference node.
# Footnote number starts at 1 and is incremented whenever a new footnote
# identifier appears.
#
# Example (Markdown):
#

        mapping[id] = num
        num += 1
      child.footnoteNumber = mapping[id]
    if child.children
      num = defineFootnoteNumber(child, num, mapping).maxNumber
  {mapping, maxNumber: num}

# Sets `footnoteNumber` property to every footnote definition node using a
# given identifier-to-number mapping. `footnoteNumber` of a definition with
