# Path: templar/markdown.py
# def convert(text):
#     return Markdown(text).text
# 
# class Markdown:
#     def __init__(self, text, pre_hook=None, post_hook=None):
#         if pre_hook:
#             text = pre_hook(text)
#         self.text, self.variables, self.references, self.footnotes = preprocess(text, self)
#         self.text = self.convert(self.text, footnotes=True).strip()
#         if post_hook:
#             self.text = post_hook(self.text)
# 
#     def convert(self, text, footnotes=False):
#         text, hashes = apply_hashes(text, self)
#         text = apply_substitutions(text)
#         text = unhash(text, hashes)
#         text = postprocess(text, self, footnotes)
#         return text
# 
#     def __add__(self, other):
#         if type(other) not in (Markdown, str):
#             raise ValueError('Cannot add {} to Markdown object'.format(
#                              other))
#         return self.text + other
# 
#     def __radd__(self, other):
#         return self + other
# 
#     def __getitem__(self, index):
#         if type(index) == int:
#             return self.text[index]
#         elif type(index) == str:
#             return self.variables[index]
#         else:
#             raise KeyError('Invalid index/key for Markdown object: {}'.format(index))
# 
#     def __setitem__(self, key, value):
#         if type(key) != str:
#             raise KeyError('Invalid key for Markdown object: {}'.format(index))
#         self.variables[key] = value
# 
#     def __repr__(self):
#         return self.text


import os
import unittest
import re
import textwrap
from templar.markdown import convert, Markdown
        text = self.dedent(text)
        return re.sub('\s+', '', text, flags=re.S)

class MarkdownTest(TemplarTest):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def assertMarkdown(self, markdown, output):
        markdown = self.dedent(markdown)
        output = self.dedent(output)
        try:
            self.assertEqual(output + '\n', convert(markdown) + '\n')
        except AssertionError:
            raise

    def assertMarkdownNotEqual(self, markdown, output):
        markdown = self.dedent(markdown)
        output = self.dedent(output)
        try:
            self.assertNotEqual(output, convert(markdown))
        except AssertionError:
            raise

    def assertMarkdownIgnoreWS(self, markdown, output):
        markdown = self.dedent(markdown)
        try:
            self.assertEqual(self.ignoreWhitespace(output),

# Path: templar/markdown.py
# def convert(text):
#     return Markdown(text).text
# 
# class Markdown:
#     def __init__(self, text, pre_hook=None, post_hook=None):
#         if pre_hook:
#             text = pre_hook(text)
#         self.text, self.variables, self.references, self.footnotes = preprocess(text, self)
#         self.text = self.convert(self.text, footnotes=True).strip()
#         if post_hook:
#             self.text = post_hook(self.text)
# 
#     def convert(self, text, footnotes=False):
#         text, hashes = apply_hashes(text, self)
#         text = apply_substitutions(text)
#         text = unhash(text, hashes)
#         text = postprocess(text, self, footnotes)
#         return text
# 
#     def __add__(self, other):
#         if type(other) not in (Markdown, str):
#             raise ValueError('Cannot add {} to Markdown object'.format(
#                              other))
#         return self.text + other
# 
#     def __radd__(self, other):
#         return self + other
# 
#     def __getitem__(self, index):
#         if type(index) == int:
#             return self.text[index]
#         elif type(index) == str:
#             return self.variables[index]
#         else:
#             raise KeyError('Invalid index/key for Markdown object: {}'.format(index))
# 
#     def __setitem__(self, key, value):
#         if type(key) != str:
#             raise KeyError('Invalid key for Markdown object: {}'.format(index))
#         self.variables[key] = value
# 
#     def __repr__(self):
#         return self.text


# Path: tests/markdown_test/test_utils.py
import os
import unittest
import re
import textwrap
from templar.markdown import convert, Markdown

        text = self.dedent(text)
        return re.sub('\s+', '', text, flags=re.S)

class MarkdownTest(TemplarTest):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def assertMarkdown(self, markdown, output):
        markdown = self.dedent(markdown)
        output = self.dedent(output)
        try:
            self.assertEqual(output + '\n', convert(markdown) + '\n')
        except AssertionError:
            raise

    def assertMarkdownNotEqual(self, markdown, output):
        markdown = self.dedent(markdown)
        output = self.dedent(output)
        try:
            self.assertNotEqual(output, convert(markdown))
        except AssertionError:
            raise

    def assertMarkdownIgnoreWS(self, markdown, output):
        markdown = self.dedent(markdown)
        try:
            self.assertEqual(self.ignoreWhitespace(output),

                             self.ignoreWhitespace(convert(markdown)))