def METHOD_NAME(mdin, mdout, line):
    listing_start = re.match('.*{#(lst:.*)\s+.c\s+.*',line)
    listing_end   = re.match('\s*~~~~\s*\n',line)
    if listing_start:
        insert_anchor(mdout, listing_start.group(1))
        line = ''
    elif listing_end:
        mdout.write("\n")
        line = ''
    return line