def METHOD_NAME(method):
    markdown_note = method[14:]
    prev = 0
    note_data = ""
    media = None
    buttons_list = []
    if catmedia := MEDIA_PATH_REGEX.search(markdown_note):
        media = catmedia.group(2)
        markdown_note = markdown_note.replace(catmedia.group(0), "")
    for match in BTN_URL_REGEX.finditer(markdown_note):
        n_escapes = 0
        to_check = match.start(1) - 1
        while to_check > 0 and markdown_note[to_check] == "\\":
            n_escapes += 1
            to_check -= 1
        if n_escapes % 2 == 0:
            buttons_list.append((match.group(2), match.group(3), bool(match.group(4))))
            note_data += markdown_note[prev : match.start(1)]
            prev = match.end(1)
        elif n_escapes % 2 == 1:
            note_data += markdown_note[prev:to_check]
            prev = match.start(1) - 1
        else:
            break
    else:
        note_data += markdown_note[prev:]
    text = note_data.strip()
    buttons = build_inline_keyboard(buttons_list)
    return (text, buttons, media)