def METHOD_NAME(mdin, mdout, line):
    # detect figure reference
    figure_ref = re.match('.*({@(fig:.*)})',line)
    if figure_ref:
        md_reference = "[below](#"+figure_ref.group(2)+")"
        line = line.replace(figure_ref.group(1), md_reference) 
        mdout.write(line)
        line = ''
    return line