INNER CODE UNIT · Python

key

MrMKN/PROFESSOR-BOT · utils.py:232

        key = text[0] + text[0]
    return list(filter(None, [key, rest]))

def parser(text, keyword, cb_data):
    if "buttonalert" in text: text = (text.replace("\n", "\\n").replace("\t", "\\t"))
    buttons = []
    note_data = ""
    prev = 0
    i = 0
    alerts = []
    for match in BTN_URL_REGEX.finditer(text):
        n_escapes = 0
        to_check = match.start(1) - 1
        while to_check > 0 and text[to_check] == "\\":
            n_escapes += 1
            to_check -= 1
        # if even, not escaped -> create button
        if n_escapes % 2 == 0:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…