# Path: mistletoe/span_token.py
# def tokenize_inner(content):
# def add_token(token_cls, position=1):
# def remove_token(token_cls):
# def reset_tokens():
#     def __init__(self, match):
#     def __contains__(self, text):
#     def find(cls, string):
#     def __new__(self, match):
#     def find(cls, string):
#     def __init__(self, match):
#     def find(cls, string):
#     def __init__(self, match):
#     def __init__(self, match):
#     def __init__(self, match):
#     def __init__(self, match):
#     def strip(cls, string):
#     def __init__(self, match):
#     def __init__(self, content):
# class SpanToken:
# class CoreTokens(SpanToken):
# class Strong(SpanToken):
# class Emphasis(SpanToken):
# class InlineCode(SpanToken):
# class Strikethrough(SpanToken):
# class Image(SpanToken):
# class Link(SpanToken):
# class AutoLink(SpanToken):
# class EscapeSequence(SpanToken):
# class LineBreak(SpanToken):
# class RawText(SpanToken):
# class HTMLSpan(SpanToken):
# class XWikiBlockMacroStart(SpanToken):
# class XWikiBlockMacroEnd(SpanToken):
# 
# Path: mistletoe/core_tokens.py
# def find_core_tokens(string, root):
# def find_link_image(string, offset, delimiters, matches, root=None):
# def process_emphasis(string, stack_bottom, delimiters, matches):
# def match_link_image(string, offset, delimiter, root=None):
# def match_link_dest(string, offset):
# def match_link_title(string, offset):
# def match_link_label(string, offset, root=None):
# def is_link_label(text, root):
# def normalize_label(text):
# def next_closer(curr_pos, delimiters):
# def matching_opener(curr_pos, delimiters, bottom):
# def is_opener(start, end, string):
# def is_closer(start, end, string):
# def is_left_delimiter(start, end, string):
# def is_right_delimiter(start, end, string):
# def preceded_by(start, string, charset):
# def succeeded_by(end, string, charset):
# def is_control_char(char):
# def follows(string, index, char):
# def shift_whitespace(string, index):
# def deactivate_delimiters(delimiters, index, delimiter_type):
#     def __init__(self, start, end, string):
#     def remove(self, n, left=True):
#     def closed_by(self, other):
#     def __repr__(self):
#     def __init__(self, start, end, *fields):
#     def start(self, n=0):
#     def end(self, n=0):
#     def group(self, n=0):
#     def __repr__(self):
# class Delimiter:
# class MatchObj:


import re
import sys
import mistletoe.block_tokenizer as tokenizer
from itertools import zip_longest
from mistletoe import span_token
from mistletoe.core_tokens import (
        is_link_label,
        follows,
        shift_whitespace,
        whitespace,
        is_control_char,
        normalize_label,
)
                if label.strip() != '':
                    return start, end+1, label
                return None
            elif escaped:
                escaped = False
        return None

    @classmethod
    def match_link_dest(cls, string, offset):
        offset = shift_whitespace(string, offset+1)
        if offset == len(string):
            return None
        if string[offset] == '<':
            escaped = False
            for i, c in enumerate(string[offset+1:], start=offset+1):
                if c == '\\' and not escaped:
                    escaped = True
                elif c == ' ' or c == '\n' or (c == '<' and not escaped):
                    return None
                elif c == '>' and not escaped:
                    return offset, i+1, string[offset+1:i]
                elif escaped:
                    escaped = False
            return None
        else:
            escaped = False
            count = 0
            for i, c in enumerate(string[offset:], start=offset):
                if c == '\\' and not escaped:
                    escaped = True

# Path: mistletoe/span_token.py
# def tokenize_inner(content):
# def add_token(token_cls, position=1):
# def remove_token(token_cls):
# def reset_tokens():
#     def __init__(self, match):
#     def __contains__(self, text):
#     def find(cls, string):
#     def __new__(self, match):
#     def find(cls, string):
#     def __init__(self, match):
#     def find(cls, string):
#     def __init__(self, match):
#     def __init__(self, match):
#     def __init__(self, match):
#     def __init__(self, match):
#     def strip(cls, string):
#     def __init__(self, match):
#     def __init__(self, content):
# class SpanToken:
# class CoreTokens(SpanToken):
# class Strong(SpanToken):
# class Emphasis(SpanToken):
# class InlineCode(SpanToken):
# class Strikethrough(SpanToken):
# class Image(SpanToken):
# class Link(SpanToken):
# class AutoLink(SpanToken):
# class EscapeSequence(SpanToken):
# class LineBreak(SpanToken):
# class RawText(SpanToken):
# class HTMLSpan(SpanToken):
# class XWikiBlockMacroStart(SpanToken):
# class XWikiBlockMacroEnd(SpanToken):
# 
# Path: mistletoe/core_tokens.py
# def find_core_tokens(string, root):
# def find_link_image(string, offset, delimiters, matches, root=None):
# def process_emphasis(string, stack_bottom, delimiters, matches):
# def match_link_image(string, offset, delimiter, root=None):
# def match_link_dest(string, offset):
# def match_link_title(string, offset):
# def match_link_label(string, offset, root=None):
# def is_link_label(text, root):
# def normalize_label(text):
# def next_closer(curr_pos, delimiters):
# def matching_opener(curr_pos, delimiters, bottom):
# def is_opener(start, end, string):
# def is_closer(start, end, string):
# def is_left_delimiter(start, end, string):
# def is_right_delimiter(start, end, string):
# def preceded_by(start, string, charset):
# def succeeded_by(end, string, charset):
# def is_control_char(char):
# def follows(string, index, char):
# def shift_whitespace(string, index):
# def deactivate_delimiters(delimiters, index, delimiter_type):
#     def __init__(self, start, end, string):
#     def remove(self, n, left=True):
#     def closed_by(self, other):
#     def __repr__(self):
#     def __init__(self, start, end, *fields):
#     def start(self, n=0):
#     def end(self, n=0):
#     def group(self, n=0):
#     def __repr__(self):
# class Delimiter:
# class MatchObj:


# Path: mistletoe/block_token.py
import re
import sys
import mistletoe.block_tokenizer as tokenizer
from itertools import zip_longest
from mistletoe import span_token
from mistletoe.core_tokens import (
        is_link_label,
        follows,
        shift_whitespace,
        whitespace,
        is_control_char,
        normalize_label,
)

                if label.strip() != '':
                    return start, end+1, label
                return None
            elif escaped:
                escaped = False
        return None

    @classmethod
    def match_link_dest(cls, string, offset):
        offset = shift_whitespace(string, offset+1)
        if offset == len(string):
            return None
        if string[offset] == '<':
            escaped = False
            for i, c in enumerate(string[offset+1:], start=offset+1):
                if c == '\\' and not escaped:
                    escaped = True
                elif c == ' ' or c == '\n' or (c == '<' and not escaped):
                    return None
                elif c == '>' and not escaped:
                    return offset, i+1, string[offset+1:i]
                elif escaped:
                    escaped = False
            return None
        else:
            escaped = False
            count = 0
            for i, c in enumerate(string[offset:], start=offset):
                if c == '\\' and not escaped:
                    escaped = True

                elif c in whitespace: