def METHOD_NAME(inline, m, state):
    key = unikey(m.group(1))
    def_footnotes = state.get('def_footnotes')
    if not def_footnotes or key not in def_footnotes:
        return 'text', m.group(0)
    index = state.get('footnote_index', 0)
    index += 1
    state['footnote_index'] = index
    state['footnotes'].append(key)
    return 'footnote_ref', key, index