# 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/block_token.py
# class Document(BlockToken):
#     """
#     Document token.
#     """
#     def __init__(self, lines):
#         if isinstance(lines, str):
#             lines = lines.splitlines(keepends=True)
#         lines = [line if line.endswith('\n') else '{}\n'.format(line) for line in lines]
#         self.footnotes = {}
#         global _root_node
#         _root_node = self
#         span_token._root_node = self
#         self.children = tokenize(lines)
#         span_token._root_node = None
#         _root_node = None
# 
# 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: contrib/github_wiki.py
# class GithubWiki(SpanToken):
#     pattern = re.compile(r"\[\[ *(.+?) *\| *(.+?) *\]\]")
# 
#     def __init__(self, match):
#         self.target = match.group(2)
# 
# class GithubWikiRenderer(HTMLRenderer):
#     def __init__(self):
#         super().__init__(GithubWiki)
# 
#     def render_github_wiki(self, token):
#         template = '<a href="{target}">{inner}</a>'
#         target = self.escape_url(token.target)
#         inner = self.render_inner(token)
#         return template.format(target=target, inner=inner)


from unittest import TestCase, mock
from mistletoe import span_token, Document
from mistletoe.span_token import tokenize_inner, _token_types
from contrib.github_wiki import GithubWiki, GithubWikiRenderer


class TestGithubWiki(TestCase):
    def setUp(self):
        span_token._root_node = Document([])

# 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/block_token.py
# class Document(BlockToken):
#     """
#     Document token.
#     """
#     def __init__(self, lines):
#         if isinstance(lines, str):
#             lines = lines.splitlines(keepends=True)
#         lines = [line if line.endswith('\n') else '{}\n'.format(line) for line in lines]
#         self.footnotes = {}
#         global _root_node
#         _root_node = self
#         span_token._root_node = self
#         self.children = tokenize(lines)
#         span_token._root_node = None
#         _root_node = None
# 
# 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: contrib/github_wiki.py
# class GithubWiki(SpanToken):
#     pattern = re.compile(r"\[\[ *(.+?) *\| *(.+?) *\]\]")
# 
#     def __init__(self, match):
#         self.target = match.group(2)
# 
# class GithubWikiRenderer(HTMLRenderer):
#     def __init__(self):
#         super().__init__(GithubWiki)
# 
#     def render_github_wiki(self, token):
#         template = '<a href="{target}">{inner}</a>'
#         target = self.escape_url(token.target)
#         inner = self.render_inner(token)
#         return template.format(target=target, inner=inner)


# Path: test/test_contrib/test_github_wiki.py
from unittest import TestCase, mock
from mistletoe import span_token, Document
from mistletoe.span_token import tokenize_inner, _token_types
from contrib.github_wiki import GithubWiki, GithubWikiRenderer



class TestGithubWiki(TestCase):
    def setUp(self):
        span_token._root_node = Document([])

        self.renderer = GithubWikiRenderer()