def METHOD_NAME(md, result, state):
    footnotes = state.get('footnotes')
    if not footnotes:
        return result
    children = [
        parse_footnote_item(md.block, k, i + 1, state)
        for i, k in enumerate(footnotes)
    ]
    tokens = [{'type': 'footnotes', 'children': children}]
    output = md.block.render(tokens, md.inline, state)
    return result + output