From cc452998dc1af441cf3f9c5d0c7287cb5de48c4a Mon Sep 17 00:00:00 2001
From: Waylan Limberg
That is:
The link URL may, optionally, be surrounded by angle brackets:
[id]: <http://example.com/> "Optional Title Here"
@@ -660,10 +660,10 @@ for links, allowing for two styles: inline and reference.
- An exclamation mark:
!
;
- followed by a set of square brackets, containing the
alt
-attribute text for the image;
+ attribute text for the image;
- followed by a set of parentheses, containing the URL or path to
-the image, and an optional
title
attribute enclosed in double
-or single quotes.
+ the image, and an optional title
attribute enclosed in double
+ or single quotes.
Reference-style image syntax looks like this:
![Alt text][id]
diff --git a/tests/extensions-x-def_list/test.cfg b/tests/extensions-x-def_list/test.cfg
new file mode 100644
index 0000000..c9f352d
--- /dev/null
+++ b/tests/extensions-x-def_list/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=def_list
diff --git a/tests/extensions-x-footnotes/test.cfg b/tests/extensions-x-footnotes/test.cfg
new file mode 100644
index 0000000..a5f0818
--- /dev/null
+++ b/tests/extensions-x-footnotes/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=footnotes
diff --git a/tests/extensions-x-tables/test.cfg b/tests/extensions-x-tables/test.cfg
new file mode 100644
index 0000000..ce5a83d
--- /dev/null
+++ b/tests/extensions-x-tables/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=tables
diff --git a/tests/extensions-x-toc/syntax-toc.html b/tests/extensions-x-toc/syntax-toc.html
index eea5347..3559d45 100644
--- a/tests/extensions-x-toc/syntax-toc.html
+++ b/tests/extensions-x-toc/syntax-toc.html
@@ -461,12 +461,12 @@ on a line by itself:
That is:
- Square brackets containing the link identifier (optionally
-indented from the left margin using up to three spaces);
+ indented from the left margin using up to three spaces);
- followed by a colon;
- followed by one or more spaces (or tabs);
- followed by the URL for the link;
- optionally followed by a title attribute for the link, enclosed
-in double or single quotes.
+ in double or single quotes.
The link URL may, optionally, be surrounded by angle brackets:
[id]: <http://example.com/> "Optional Title Here"
@@ -634,10 +634,10 @@ for links, allowing for two styles: inline and reference.
- An exclamation mark:
!
;
- followed by a set of square brackets, containing the
alt
-attribute text for the image;
+ attribute text for the image;
- followed by a set of parentheses, containing the URL or path to
-the image, and an optional
title
attribute enclosed in double
-or single quotes.
+ the image, and an optional title
attribute enclosed in double
+ or single quotes.
Reference-style image syntax looks like this:
![Alt text][id]
diff --git a/tests/extensions-x-toc/test.cfg b/tests/extensions-x-toc/test.cfg
new file mode 100644
index 0000000..e4bc0fe
--- /dev/null
+++ b/tests/extensions-x-toc/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=toc
diff --git a/tests/extensions-x-wikilinks/test.cfg b/tests/extensions-x-wikilinks/test.cfg
new file mode 100644
index 0000000..959f38a
--- /dev/null
+++ b/tests/extensions-x-wikilinks/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=wikilinks
diff --git a/tests/extensions-x-wikilinks/wikilinks.html b/tests/extensions-x-wikilinks/wikilinks.html
index 1a38535..a76a693 100644
--- a/tests/extensions-x-wikilinks/wikilinks.html
+++ b/tests/extensions-x-wikilinks/wikilinks.html
@@ -1,5 +1,8 @@
Some text with a WikiLink.
A link with white space and_underscores and a empty one.
+Another with double spaces and double__underscores and
+one that has emphasis inside and one with_multiple_underscores
+and one that is emphasised.
And a RealLink.
http://example.com/And_A_AutoLink
And a MarkdownLink for
diff --git a/tests/html4/test.cfg b/tests/html4/test.cfg
new file mode 100644
index 0000000..a3fc498
--- /dev/null
+++ b/tests/html4/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+output_format=html4
diff --git a/tests/markdown-test/markdown-syntax.html b/tests/markdown-test/markdown-syntax.html
index 2f63b4b..038c9d1 100644
--- a/tests/markdown-test/markdown-syntax.html
+++ b/tests/markdown-test/markdown-syntax.html
@@ -484,12 +484,12 @@ on a line by itself:
That is:
- Square brackets containing the link identifier (optionally
-indented from the left margin using up to three spaces);
+ indented from the left margin using up to three spaces);
- followed by a colon;
- followed by one or more spaces (or tabs);
- followed by the URL for the link;
- optionally followed by a title attribute for the link, enclosed
-in double or single quotes.
+ in double or single quotes.
The link URL may, optionally, be surrounded by angle brackets:
[id]: <http://example.com/> "Optional Title Here"
@@ -660,10 +660,10 @@ for links, allowing for two styles: inline and reference.
- An exclamation mark:
!
;
- followed by a set of square brackets, containing the
alt
-attribute text for the image;
+ attribute text for the image;
- followed by a set of parentheses, containing the URL or path to
-the image, and an optional
title
attribute enclosed in double
-or single quotes.
+ the image, and an optional title
attribute enclosed in double
+ or single quotes.
Reference-style image syntax looks like this:
![Alt text][id]
diff --git a/tests/markdown-test/tabs.html b/tests/markdown-test/tabs.html
index b26391b..3c11f14 100644
--- a/tests/markdown-test/tabs.html
+++ b/tests/markdown-test/tabs.html
@@ -1,11 +1,11 @@
-
this is a list item
-indented with tabs
+ indented with tabs
-
this is a list item
-indented with spaces
+ indented with spaces
Code:
diff --git a/tests/misc/em-around-links.html b/tests/misc/em-around-links.html
index 06bfa8e..fafac28 100644
--- a/tests/misc/em-around-links.html
+++ b/tests/misc/em-around-links.html
@@ -1,16 +1,13 @@
Title
-
- - Python in Markdown by some
+
- Python in Markdown by some
great folks - This does work as expected.
- - Python in Markdown by some
+
- Python in Markdown by some
great folks - This does work as expected.
- - Python in Markdown by some
+
- Python in Markdown by some
great folks - This does work as expected.
- - Python in Markdown by some
+
- Python in Markdown by some
great folks - This does work as expected.
-
Python in Markdown by some
- great folks - This does work as expected.
-
+great folks - This does work as expected.
\ No newline at end of file
diff --git a/tests/misc/multi-paragraph-block-quote.html b/tests/misc/multi-paragraph-block-quote.html
index e13986a..f01b5e4 100644
--- a/tests/misc/multi-paragraph-block-quote.html
+++ b/tests/misc/multi-paragraph-block-quote.html
@@ -1,6 +1,6 @@
This is line one of paragraph one
- This is line two of paragraph one
+This is line two of paragraph one
This is line one of paragraph two
This is another blockquote.
\ No newline at end of file
diff --git a/tests/misc/tabs-in-lists.html b/tests/misc/tabs-in-lists.html
index a1a92ec..fdb7cb6 100644
--- a/tests/misc/tabs-in-lists.html
+++ b/tests/misc/tabs-in-lists.html
@@ -19,7 +19,7 @@
Now a list with 4 spaces and some text:
- A
-abcdef
+ abcdef
- B
Now with a tab and an extra space:
diff --git a/tests/plugins.py b/tests/plugins.py
new file mode 100644
index 0000000..d0cb7f8
--- /dev/null
+++ b/tests/plugins.py
@@ -0,0 +1,113 @@
+import traceback
+from util import MdSyntaxError
+from nose.plugins import Plugin
+from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin
+
+class MdSyntaxErrorPlugin(ErrorClassPlugin):
+ """ Add MdSyntaxError and ensure proper formatting. """
+ mdsyntax = ErrorClass(MdSyntaxError, label='MdSyntaxError', isfailure=True)
+ enabled = True
+
+ def configure(self, options, conf):
+ self.conf = conf
+
+ def addError(self, test, err):
+ """ Ensure other plugins see the error by returning nothing here. """
+ pass
+
+ def formatError(self, test, err):
+ """ Remove unnessecary and unhelpful traceback from error report. """
+ et, ev, tb = err
+ if et.__name__ == 'MdSyntaxError':
+ return et, ev, ''
+ return err
+
+
+def escape(html):
+ """ Escape HTML for display as source within HTML. """
+ html = html.replace('&', '&')
+ html = html.replace('<', '<')
+ html = html.replace('>', '>')
+ return html
+
+
+class HtmlOutput(Plugin):
+ """Output test results as ugly, unstyled html. """
+
+ name = 'html-output'
+ score = 2 # run late
+ enabled = True
+
+ def __init__(self):
+ super(HtmlOutput, self).__init__()
+ self.html = [ '',
+ 'Test output ',
+ '' ]
+
+ def configure(self, options, conf):
+ self.conf = conf
+
+ def addSuccess(self, test):
+ self.html.append('ok')
+
+ def addError(self, test, err):
+ err = self.formatErr(err)
+ self.html.append('ERROR')
+ self.html.append('%s
' % escape(err))
+
+ def addFailure(self, test, err):
+ err = self.formatErr(err)
+ self.html.append('FAIL')
+ self.html.append('%s
' % escape(err))
+
+ def finalize(self, result):
+ self.html.append('')
+ self.html.append("Ran %d test%s" %
+ (result.testsRun, result.testsRun != 1 and "s"
+or ""))
+ self.html.append('')
+ self.html.append('')
+ if not result.wasSuccessful():
+ self.html.extend(['FAILED (',
+ 'failures=%d ' % len(result.failures),
+ 'errors=%d' % len(result.errors)])
+ for cls in result.errorClasses.keys():
+ storage, label, isfail = result.errorClasses[cls]
+ if isfail:
+ self.html.append(' %ss=%d' % (label, len(storage)))
+ self.html.append(')')
+ else:
+ self.html.append('OK')
+ self.html.append('')
+ f = open('tmp/test-output.html', 'w')
+ for l in self.html:
+ f.write(l)
+ f.close()
+
+ def formatErr(self, err):
+ exctype, value, tb = err
+ return ''.join(traceback.format_exception(exctype, value, tb))
+
+ def startContext(self, ctx):
+ try:
+ n = ctx.__name__
+ except AttributeError:
+ n = str(ctx).replace('<', '').replace('>', '')
+ self.html.extend(['')
+
+ def startTest(self, test):
+ self.html.extend([ '',
+ test.shortDescription() or str(test),
+ '' ])
+
+ def stopTest(self, test):
+ self.html.append('')
+
diff --git a/tests/safe_mode/test.cfg b/tests/safe_mode/test.cfg
new file mode 100644
index 0000000..d23e418
--- /dev/null
+++ b/tests/safe_mode/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+safe_mode=escape
diff --git a/tests/test_apis.py b/tests/test_apis.py
new file mode 100755
index 0000000..59b5a2e
--- /dev/null
+++ b/tests/test_apis.py
@@ -0,0 +1,234 @@
+#!/usr/bin/python
+"""
+Python-Markdown Regression Tests
+================================
+
+Tests of the various APIs with the python markdown lib.
+
+"""
+
+import unittest
+from doctest import DocTestSuite
+import os
+import markdown
+
+class TestMarkdownBasics(unittest.TestCase):
+ """ Tests basics of the Markdown class. """
+
+ def setUp(self):
+ """ Create instance of Markdown. """
+ self.md = markdown.Markdown()
+
+ def testBlankInput(self):
+ """ Test blank input. """
+ self.assertEqual(self.md.convert(''), '')
+
+ def testWhitespaceOnly(self):
+ """ Test input of only whitespace. """
+ self.assertEqual(self.md.convert(' '), '')
+
+ def testSimpleInput(self):
+ """ Test simple input. """
+ self.assertEqual(self.md.convert('foo'), 'foo
')
+
+class TestBlockParser(unittest.TestCase):
+ """ Tests of the BlockParser class. """
+
+ def setUp(self):
+ """ Create instance of BlockParser. """
+ self.parser = markdown.Markdown().parser
+
+ def testParseChunk(self):
+ """ Test BlockParser.parseChunk. """
+ root = markdown.etree.Element("div")
+ text = 'foo'
+ self.parser.parseChunk(root, text)
+ self.assertEqual(markdown.etree.tostring(root), "foo
")
+
+ def testParseDocument(self):
+ """ Test BlockParser.parseDocument. """
+ lines = ['#foo', '', 'bar', '', ' baz']
+ tree = self.parser.parseDocument(lines)
+ self.assert_(isinstance(tree, markdown.etree.ElementTree))
+ self.assert_(markdown.etree.iselement(tree.getroot()))
+ self.assertEqual(markdown.etree.tostring(tree.getroot()),
+ "foo
bar
baz\n
")
+
+
+class TestBlockParserState(unittest.TestCase):
+ """ Tests of the State class for BlockParser. """
+
+ def setUp(self):
+ self.state = markdown.blockparser.State()
+
+ def testBlankState(self):
+ """ Test State when empty. """
+ self.assertEqual(self.state, [])
+
+ def testSetSate(self):
+ """ Test State.set(). """
+ self.state.set('a_state')
+ self.assertEqual(self.state, ['a_state'])
+ self.state.set('state2')
+ self.assertEqual(self.state, ['a_state', 'state2'])
+
+ def testIsSate(self):
+ """ Test State.isstate(). """
+ self.assertEqual(self.state.isstate('anything'), False)
+ self.state.set('a_state')
+ self.assertEqual(self.state.isstate('a_state'), True)
+ self.state.set('state2')
+ self.assertEqual(self.state.isstate('state2'), True)
+ self.assertEqual(self.state.isstate('a_state'), False)
+ self.assertEqual(self.state.isstate('missing'), False)
+
+ def testReset(self):
+ """ Test State.reset(). """
+ self.state.set('a_state')
+ self.state.reset()
+ self.assertEqual(self.state, [])
+ self.state.set('state1')
+ self.state.set('state2')
+ self.state.reset()
+ self.assertEqual(self.state, ['state1'])
+
+class TestHtmlStash(unittest.TestCase):
+ """ Test Markdown's HtmlStash. """
+
+ def setUp(self):
+ self.stash = markdown.preprocessors.HtmlStash()
+ self.placeholder = self.stash.store('foo')
+
+ def testSimpleStore(self):
+ """ Test HtmlStash.store. """
+ self.assertEqual(self.placeholder,
+ markdown.preprocessors.HTML_PLACEHOLDER % 0)
+ self.assertEqual(self.stash.html_counter, 1)
+ self.assertEqual(self.stash.rawHtmlBlocks, [('foo', False)])
+
+ def testStoreMore(self):
+ """ Test HtmlStash.store with additional blocks. """
+ placeholder = self.stash.store('bar')
+ self.assertEqual(placeholder,
+ markdown.preprocessors.HTML_PLACEHOLDER % 1)
+ self.assertEqual(self.stash.html_counter, 2)
+ self.assertEqual(self.stash.rawHtmlBlocks,
+ [('foo', False), ('bar', False)])
+
+ def testSafeStore(self):
+ """ Test HtmlStash.store with 'safe' html. """
+ self.stash.store('bar', True)
+ self.assertEqual(self.stash.rawHtmlBlocks,
+ [('foo', False), ('bar', True)])
+
+ def testReset(self):
+ """ Test HtmlStash.reset. """
+ self.stash.reset()
+ self.assertEqual(self.stash.html_counter, 0)
+ self.assertEqual(self.stash.rawHtmlBlocks, [])
+
+class TestOrderedDict(unittest.TestCase):
+ """ Test OrderedDict storage class. """
+
+ def setUp(self):
+ self.odict = markdown.odict.OrderedDict()
+ self.odict['first'] = 'This'
+ self.odict['third'] = 'a'
+ self.odict['fourth'] = 'self'
+ self.odict['fifth'] = 'test'
+
+ def testValues(self):
+ """ Test output of OrderedDict.values(). """
+ self.assertEqual(self.odict.values(), ['This', 'a', 'self', 'test'])
+
+ def testKeys(self):
+ """ Test output of OrderedDict.keys(). """
+ self.assertEqual(self.odict.keys(),
+ ['first', 'third', 'fourth', 'fifth'])
+
+ def testItems(self):
+ """ Test output of OrderedDict.items(). """
+ self.assertEqual(self.odict.items(),
+ [('first', 'This'), ('third', 'a'),
+ ('fourth', 'self'), ('fifth', 'test')])
+
+ def testAddBefore(self):
+ """ Test adding an OrderedDict item before a given key. """
+ self.odict.add('second', 'is', 'first')
+ self.assertEqual(self.odict.items(),
+ [('first', 'This'), ('second', 'is'), ('third', 'a'),
+ ('fourth', 'self'), ('fifth', 'test')])
+
+ def testAddAfterEnd(self):
+ """ Test adding an OrderedDict item after the last key. """
+ self.odict.add('sixth', '.', '>fifth')
+ self.assertEqual(self.odict.items(),
+ [('first', 'This'), ('third', 'a'),
+ ('fourth', 'self'), ('fifth', 'test'), ('sixth', '.')])
+
+ def testAdd_begin(self):
+ """ Test adding an OrderedDict item using "_begin". """
+ self.odict.add('zero', 'CRAZY', '_begin')
+ self.assertEqual(self.odict.items(),
+ [('zero', 'CRAZY'), ('first', 'This'), ('third', 'a'),
+ ('fourth', 'self'), ('fifth', 'test')])
+
+ def testAdd_end(self):
+ """ Test adding an OrderedDict item using "_end". """
+ self.odict.add('sixth', '.', '_end')
+ self.assertEqual(self.odict.items(),
+ [('first', 'This'), ('third', 'a'),
+ ('fourth', 'self'), ('fifth', 'test'), ('sixth', '.')])
+
+ def testAddBadLocation(self):
+ """ Test Error on bad location in OrderedDict.add(). """
+ self.assertRaises(ValueError, self.odict.add, 'sixth', '.', '
Date: Sat, 30 May 2009 22:31:55 -0400
Subject: Moves tests to a subdir of the markdown lib.
---
markdown/tests/__init__.py | 44 +
markdown/tests/base.py | 62 ++
markdown/tests/extensions-x-abbr/abbr.html | 4 +
markdown/tests/extensions-x-abbr/abbr.txt | 13 +
markdown/tests/extensions-x-abbr/test.cfg | 2 +
markdown/tests/extensions-x-codehilite/code.html | 16 +
markdown/tests/extensions-x-codehilite/code.txt | 12 +
markdown/tests/extensions-x-codehilite/test.cfg | 2 +
.../extensions-x-def_list/loose_def_list.html | 21 +
.../tests/extensions-x-def_list/loose_def_list.txt | 20 +
.../extensions-x-def_list/markdown-syntax.html | 728 +++++++++++++++++
.../extensions-x-def_list/markdown-syntax.txt | 888 +++++++++++++++++++++
.../extensions-x-def_list/simple_def-lists.html | 37 +
.../extensions-x-def_list/simple_def-lists.txt | 29 +
markdown/tests/extensions-x-def_list/test.cfg | 2 +
.../tests/extensions-x-footnotes/footnote.html | 29 +
markdown/tests/extensions-x-footnotes/footnote.txt | 14 +
.../extensions-x-footnotes/named_markers.html | 24 +
.../tests/extensions-x-footnotes/named_markers.txt | 9 +
markdown/tests/extensions-x-footnotes/test.cfg | 2 +
markdown/tests/extensions-x-tables/tables.html | 119 +++
markdown/tests/extensions-x-tables/tables.txt | 34 +
markdown/tests/extensions-x-tables/test.cfg | 2 +
markdown/tests/extensions-x-toc/invalid.html | 6 +
markdown/tests/extensions-x-toc/invalid.txt | 9 +
markdown/tests/extensions-x-toc/syntax-toc.html | 699 ++++++++++++++++
markdown/tests/extensions-x-toc/syntax-toc.txt | 851 ++++++++++++++++++++
markdown/tests/extensions-x-toc/test.cfg | 2 +
markdown/tests/extensions-x-wikilinks/test.cfg | 2 +
.../tests/extensions-x-wikilinks/wikilinks.html | 9 +
.../tests/extensions-x-wikilinks/wikilinks.txt | 14 +
markdown/tests/html4/html4.html | 2 +
markdown/tests/html4/html4.txt | 2 +
markdown/tests/html4/test.cfg | 2 +
.../markdown-test/amps-and-angle-encoding.html | 9 +
.../markdown-test/amps-and-angle-encoding.txt | 21 +
.../tests/markdown-test/angle-links-and-img.html | 4 +
.../tests/markdown-test/angle-links-and-img.txt | 4 +
markdown/tests/markdown-test/auto-links.html | 15 +
markdown/tests/markdown-test/auto-links.txt | 17 +
markdown/tests/markdown-test/backlash-escapes.html | 67 ++
markdown/tests/markdown-test/backlash-escapes.txt | 104 +++
markdown/tests/markdown-test/benchmark.dat | 20 +
.../blockquotes-with-code-blocks.html | 12 +
.../markdown-test/blockquotes-with-code-blocks.txt | 11 +
.../tests/markdown-test/codeblock-in-list.html | 14 +
markdown/tests/markdown-test/codeblock-in-list.txt | 10 +
markdown/tests/markdown-test/hard-wrapped.html | 7 +
markdown/tests/markdown-test/hard-wrapped.txt | 8 +
markdown/tests/markdown-test/horizontal-rules.html | 39 +
markdown/tests/markdown-test/horizontal-rules.txt | 67 ++
.../tests/markdown-test/inline-html-advanced.html | 12 +
.../tests/markdown-test/inline-html-advanced.txt | 14 +
.../tests/markdown-test/inline-html-comments.html | 11 +
.../tests/markdown-test/inline-html-comments.txt | 13 +
.../tests/markdown-test/inline-html-simple.html | 58 ++
.../tests/markdown-test/inline-html-simple.txt | 69 ++
markdown/tests/markdown-test/links-inline.html | 5 +
markdown/tests/markdown-test/links-inline.txt | 9 +
markdown/tests/markdown-test/links-reference.html | 10 +
markdown/tests/markdown-test/links-reference.txt | 31 +
markdown/tests/markdown-test/literal-quotes.html | 2 +
markdown/tests/markdown-test/literal-quotes.txt | 7 +
.../markdown-documentation-basics.html | 243 ++++++
.../markdown-documentation-basics.txt | 306 +++++++
markdown/tests/markdown-test/markdown-syntax.html | 728 +++++++++++++++++
markdown/tests/markdown-test/markdown-syntax.txt | 888 +++++++++++++++++++++
.../tests/markdown-test/nested-blockquotes.html | 7 +
.../tests/markdown-test/nested-blockquotes.txt | 5 +
.../markdown-test/ordered-and-unordered-list.html | 146 ++++
.../markdown-test/ordered-and-unordered-list.txt | 122 +++
.../markdown-test/strong-and-em-together.html | 4 +
.../tests/markdown-test/strong-and-em-together.txt | 7 +
markdown/tests/markdown-test/tabs.html | 23 +
markdown/tests/markdown-test/tabs.txt | 21 +
markdown/tests/markdown-test/tidyness.html | 8 +
markdown/tests/markdown-test/tidyness.txt | 5 +
markdown/tests/misc/CRLF_line_ends.html | 4 +
markdown/tests/misc/CRLF_line_ends.txt | 5 +
markdown/tests/misc/adjacent-headers.html | 2 +
markdown/tests/misc/adjacent-headers.txt | 2 +
markdown/tests/misc/amp-in-url.html | 1 +
markdown/tests/misc/amp-in-url.txt | 1 +
markdown/tests/misc/ampersand.html | 2 +
markdown/tests/misc/ampersand.txt | 5 +
markdown/tests/misc/arabic.html | 27 +
markdown/tests/misc/arabic.txt | 37 +
markdown/tests/misc/attributes2.html | 6 +
markdown/tests/misc/attributes2.txt | 10 +
markdown/tests/misc/autolinks_with_asterisks.html | 1 +
markdown/tests/misc/autolinks_with_asterisks.txt | 2 +
.../misc/autolinks_with_asterisks_russian.html | 1 +
.../misc/autolinks_with_asterisks_russian.txt | 3 +
markdown/tests/misc/backtick-escape.html | 3 +
markdown/tests/misc/backtick-escape.txt | 3 +
markdown/tests/misc/benchmark.dat | 56 ++
markdown/tests/misc/bidi.html | 39 +
markdown/tests/misc/bidi.txt | 68 ++
markdown/tests/misc/blank-block-quote.html | 3 +
markdown/tests/misc/blank-block-quote.txt | 6 +
.../tests/misc/blockquote-below-paragraph.html | 15 +
markdown/tests/misc/blockquote-below-paragraph.txt | 11 +
markdown/tests/misc/blockquote-hr.html | 16 +
markdown/tests/misc/blockquote-hr.txt | 21 +
markdown/tests/misc/blockquote.html | 24 +
markdown/tests/misc/blockquote.txt | 21 +
markdown/tests/misc/bold_links.html | 1 +
markdown/tests/misc/bold_links.txt | 1 +
markdown/tests/misc/br.html | 11 +
markdown/tests/misc/br.txt | 16 +
markdown/tests/misc/bracket_re.html | 60 ++
markdown/tests/misc/bracket_re.txt | 61 ++
markdown/tests/misc/code-first-line.html | 2 +
markdown/tests/misc/code-first-line.txt | 1 +
markdown/tests/misc/comments.html | 5 +
markdown/tests/misc/comments.txt | 7 +
markdown/tests/misc/div.html | 4 +
markdown/tests/misc/div.txt | 5 +
markdown/tests/misc/em-around-links.html | 13 +
markdown/tests/misc/em-around-links.txt | 14 +
markdown/tests/misc/em_strong.html | 10 +
markdown/tests/misc/em_strong.txt | 20 +
markdown/tests/misc/email.html | 2 +
markdown/tests/misc/email.txt | 3 +
markdown/tests/misc/funky-list.html | 11 +
markdown/tests/misc/funky-list.txt | 9 +
markdown/tests/misc/h1.html | 3 +
markdown/tests/misc/h1.txt | 7 +
markdown/tests/misc/hash.html | 11 +
markdown/tests/misc/hash.txt | 13 +
markdown/tests/misc/headers.html | 10 +
markdown/tests/misc/headers.txt | 15 +
markdown/tests/misc/hline.html | 2 +
markdown/tests/misc/hline.txt | 5 +
markdown/tests/misc/html-comments.html | 2 +
markdown/tests/misc/html-comments.txt | 2 +
markdown/tests/misc/html.html | 9 +
markdown/tests/misc/html.txt | 13 +
markdown/tests/misc/image-2.html | 2 +
markdown/tests/misc/image-2.txt | 3 +
markdown/tests/misc/image.html | 1 +
markdown/tests/misc/image.txt | 2 +
markdown/tests/misc/image_in_links.html | 1 +
markdown/tests/misc/image_in_links.txt | 3 +
markdown/tests/misc/inside_html.html | 1 +
markdown/tests/misc/inside_html.txt | 1 +
markdown/tests/misc/japanese.html | 11 +
markdown/tests/misc/japanese.txt | 15 +
markdown/tests/misc/lazy-block-quote.html | 6 +
markdown/tests/misc/lazy-block-quote.txt | 5 +
markdown/tests/misc/link-with-parenthesis.html | 1 +
markdown/tests/misc/link-with-parenthesis.txt | 1 +
markdown/tests/misc/lists.html | 36 +
markdown/tests/misc/lists.txt | 31 +
markdown/tests/misc/lists2.html | 5 +
markdown/tests/misc/lists2.txt | 3 +
markdown/tests/misc/lists3.html | 5 +
markdown/tests/misc/lists3.txt | 3 +
markdown/tests/misc/lists4.html | 8 +
markdown/tests/misc/lists4.txt | 5 +
markdown/tests/misc/lists5.html | 14 +
markdown/tests/misc/lists5.txt | 12 +
markdown/tests/misc/markup-inside-p.html | 21 +
markdown/tests/misc/markup-inside-p.txt | 21 +
markdown/tests/misc/mismatched-tags.html | 11 +
markdown/tests/misc/mismatched-tags.txt | 9 +
markdown/tests/misc/missing-link-def.html | 1 +
markdown/tests/misc/missing-link-def.txt | 4 +
markdown/tests/misc/more_comments.html | 7 +
markdown/tests/misc/more_comments.txt | 9 +
markdown/tests/misc/multi-line-tags.html | 4 +
markdown/tests/misc/multi-line-tags.txt | 6 +
.../tests/misc/multi-paragraph-block-quote.html | 6 +
.../tests/misc/multi-paragraph-block-quote.txt | 8 +
markdown/tests/misc/multi-test.html | 20 +
markdown/tests/misc/multi-test.txt | 32 +
markdown/tests/misc/multiline-comments.html | 16 +
markdown/tests/misc/multiline-comments.txt | 18 +
markdown/tests/misc/nested-lists.html | 39 +
markdown/tests/misc/nested-lists.txt | 24 +
markdown/tests/misc/nested-patterns.html | 7 +
markdown/tests/misc/nested-patterns.txt | 7 +
markdown/tests/misc/normalize.html | 1 +
markdown/tests/misc/normalize.txt | 2 +
markdown/tests/misc/numeric-entity.html | 2 +
markdown/tests/misc/numeric-entity.txt | 4 +
markdown/tests/misc/para-with-hr.html | 3 +
markdown/tests/misc/para-with-hr.txt | 4 +
markdown/tests/misc/php.html | 11 +
markdown/tests/misc/php.txt | 13 +
markdown/tests/misc/pre.html | 13 +
markdown/tests/misc/pre.txt | 14 +
markdown/tests/misc/russian.html | 6 +
markdown/tests/misc/russian.txt | 15 +
markdown/tests/misc/some-test.html | 66 ++
markdown/tests/misc/some-test.txt | 57 ++
markdown/tests/misc/span.html | 6 +
markdown/tests/misc/span.txt | 10 +
markdown/tests/misc/strong-with-underscores.html | 1 +
markdown/tests/misc/strong-with-underscores.txt | 1 +
markdown/tests/misc/stronintags.html | 4 +
markdown/tests/misc/stronintags.txt | 8 +
markdown/tests/misc/tabs-in-lists.html | 42 +
markdown/tests/misc/tabs-in-lists.txt | 32 +
markdown/tests/misc/two-spaces.html | 21 +
markdown/tests/misc/two-spaces.txt | 17 +
markdown/tests/misc/uche.html | 3 +
markdown/tests/misc/uche.txt | 7 +
markdown/tests/misc/underscores.html | 6 +
markdown/tests/misc/underscores.txt | 11 +
markdown/tests/misc/url_spaces.html | 2 +
markdown/tests/misc/url_spaces.txt | 4 +
markdown/tests/plugins.py | 113 +++
markdown/tests/safe_mode/inline-html-advanced.html | 11 +
markdown/tests/safe_mode/inline-html-advanced.txt | 14 +
markdown/tests/safe_mode/inline-html-comments.html | 8 +
markdown/tests/safe_mode/inline-html-comments.txt | 13 +
markdown/tests/safe_mode/inline-html-simple.html | 45 ++
markdown/tests/safe_mode/inline-html-simple.txt | 69 ++
markdown/tests/safe_mode/script_tags.html | 28 +
markdown/tests/safe_mode/script_tags.txt | 33 +
markdown/tests/safe_mode/test.cfg | 2 +
markdown/tests/safe_mode/unsafe_urls.html | 20 +
markdown/tests/safe_mode/unsafe_urls.txt | 27 +
markdown/tests/test_apis.py | 234 ++++++
markdown/tests/util.py | 15 +
tests/__init__.py | 44 -
tests/base.py | 62 --
tests/extensions-x-abbr/abbr.html | 4 -
tests/extensions-x-abbr/abbr.txt | 13 -
tests/extensions-x-abbr/test.cfg | 2 -
tests/extensions-x-codehilite/code.html | 16 -
tests/extensions-x-codehilite/code.txt | 12 -
tests/extensions-x-codehilite/test.cfg | 2 -
tests/extensions-x-def_list/loose_def_list.html | 21 -
tests/extensions-x-def_list/loose_def_list.txt | 20 -
tests/extensions-x-def_list/markdown-syntax.html | 728 -----------------
tests/extensions-x-def_list/markdown-syntax.txt | 888 ---------------------
tests/extensions-x-def_list/simple_def-lists.html | 37 -
tests/extensions-x-def_list/simple_def-lists.txt | 29 -
tests/extensions-x-def_list/test.cfg | 2 -
tests/extensions-x-footnotes/footnote.html | 29 -
tests/extensions-x-footnotes/footnote.txt | 14 -
tests/extensions-x-footnotes/named_markers.html | 24 -
tests/extensions-x-footnotes/named_markers.txt | 9 -
tests/extensions-x-footnotes/test.cfg | 2 -
tests/extensions-x-tables/tables.html | 119 ---
tests/extensions-x-tables/tables.txt | 34 -
tests/extensions-x-tables/test.cfg | 2 -
tests/extensions-x-toc/invalid.html | 6 -
tests/extensions-x-toc/invalid.txt | 9 -
tests/extensions-x-toc/syntax-toc.html | 699 ----------------
tests/extensions-x-toc/syntax-toc.txt | 851 --------------------
tests/extensions-x-toc/test.cfg | 2 -
tests/extensions-x-wikilinks/test.cfg | 2 -
tests/extensions-x-wikilinks/wikilinks.html | 9 -
tests/extensions-x-wikilinks/wikilinks.txt | 14 -
tests/html4/html4.html | 2 -
tests/html4/html4.txt | 2 -
tests/html4/test.cfg | 2 -
tests/markdown-test/amps-and-angle-encoding.html | 9 -
tests/markdown-test/amps-and-angle-encoding.txt | 21 -
tests/markdown-test/angle-links-and-img.html | 4 -
tests/markdown-test/angle-links-and-img.txt | 4 -
tests/markdown-test/auto-links.html | 15 -
tests/markdown-test/auto-links.txt | 17 -
tests/markdown-test/backlash-escapes.html | 67 --
tests/markdown-test/backlash-escapes.txt | 104 ---
tests/markdown-test/benchmark.dat | 20 -
.../blockquotes-with-code-blocks.html | 12 -
.../markdown-test/blockquotes-with-code-blocks.txt | 11 -
tests/markdown-test/codeblock-in-list.html | 14 -
tests/markdown-test/codeblock-in-list.txt | 10 -
tests/markdown-test/hard-wrapped.html | 7 -
tests/markdown-test/hard-wrapped.txt | 8 -
tests/markdown-test/horizontal-rules.html | 39 -
tests/markdown-test/horizontal-rules.txt | 67 --
tests/markdown-test/inline-html-advanced.html | 12 -
tests/markdown-test/inline-html-advanced.txt | 14 -
tests/markdown-test/inline-html-comments.html | 11 -
tests/markdown-test/inline-html-comments.txt | 13 -
tests/markdown-test/inline-html-simple.html | 58 --
tests/markdown-test/inline-html-simple.txt | 69 --
tests/markdown-test/links-inline.html | 5 -
tests/markdown-test/links-inline.txt | 9 -
tests/markdown-test/links-reference.html | 10 -
tests/markdown-test/links-reference.txt | 31 -
tests/markdown-test/literal-quotes.html | 2 -
tests/markdown-test/literal-quotes.txt | 7 -
.../markdown-documentation-basics.html | 243 ------
.../markdown-documentation-basics.txt | 306 -------
tests/markdown-test/markdown-syntax.html | 728 -----------------
tests/markdown-test/markdown-syntax.txt | 888 ---------------------
tests/markdown-test/nested-blockquotes.html | 7 -
tests/markdown-test/nested-blockquotes.txt | 5 -
.../markdown-test/ordered-and-unordered-list.html | 146 ----
tests/markdown-test/ordered-and-unordered-list.txt | 122 ---
tests/markdown-test/strong-and-em-together.html | 4 -
tests/markdown-test/strong-and-em-together.txt | 7 -
tests/markdown-test/tabs.html | 23 -
tests/markdown-test/tabs.txt | 21 -
tests/markdown-test/tidyness.html | 8 -
tests/markdown-test/tidyness.txt | 5 -
tests/misc/CRLF_line_ends.html | 4 -
tests/misc/CRLF_line_ends.txt | 5 -
tests/misc/adjacent-headers.html | 2 -
tests/misc/adjacent-headers.txt | 2 -
tests/misc/amp-in-url.html | 1 -
tests/misc/amp-in-url.txt | 1 -
tests/misc/ampersand.html | 2 -
tests/misc/ampersand.txt | 5 -
tests/misc/arabic.html | 27 -
tests/misc/arabic.txt | 37 -
tests/misc/attributes2.html | 6 -
tests/misc/attributes2.txt | 10 -
tests/misc/autolinks_with_asterisks.html | 1 -
tests/misc/autolinks_with_asterisks.txt | 2 -
tests/misc/autolinks_with_asterisks_russian.html | 1 -
tests/misc/autolinks_with_asterisks_russian.txt | 3 -
tests/misc/backtick-escape.html | 3 -
tests/misc/backtick-escape.txt | 3 -
tests/misc/benchmark.dat | 56 --
tests/misc/bidi.html | 39 -
tests/misc/bidi.txt | 68 --
tests/misc/blank-block-quote.html | 3 -
tests/misc/blank-block-quote.txt | 6 -
tests/misc/blockquote-below-paragraph.html | 15 -
tests/misc/blockquote-below-paragraph.txt | 11 -
tests/misc/blockquote-hr.html | 16 -
tests/misc/blockquote-hr.txt | 21 -
tests/misc/blockquote.html | 24 -
tests/misc/blockquote.txt | 21 -
tests/misc/bold_links.html | 1 -
tests/misc/bold_links.txt | 1 -
tests/misc/br.html | 11 -
tests/misc/br.txt | 16 -
tests/misc/bracket_re.html | 60 --
tests/misc/bracket_re.txt | 61 --
tests/misc/code-first-line.html | 2 -
tests/misc/code-first-line.txt | 1 -
tests/misc/comments.html | 5 -
tests/misc/comments.txt | 7 -
tests/misc/div.html | 4 -
tests/misc/div.txt | 5 -
tests/misc/em-around-links.html | 13 -
tests/misc/em-around-links.txt | 14 -
tests/misc/em_strong.html | 10 -
tests/misc/em_strong.txt | 20 -
tests/misc/email.html | 2 -
tests/misc/email.txt | 3 -
tests/misc/funky-list.html | 11 -
tests/misc/funky-list.txt | 9 -
tests/misc/h1.html | 3 -
tests/misc/h1.txt | 7 -
tests/misc/hash.html | 11 -
tests/misc/hash.txt | 13 -
tests/misc/headers.html | 10 -
tests/misc/headers.txt | 15 -
tests/misc/hline.html | 2 -
tests/misc/hline.txt | 5 -
tests/misc/html-comments.html | 2 -
tests/misc/html-comments.txt | 2 -
tests/misc/html.html | 9 -
tests/misc/html.txt | 13 -
tests/misc/image-2.html | 2 -
tests/misc/image-2.txt | 3 -
tests/misc/image.html | 1 -
tests/misc/image.txt | 2 -
tests/misc/image_in_links.html | 1 -
tests/misc/image_in_links.txt | 3 -
tests/misc/inside_html.html | 1 -
tests/misc/inside_html.txt | 1 -
tests/misc/japanese.html | 11 -
tests/misc/japanese.txt | 15 -
tests/misc/lazy-block-quote.html | 6 -
tests/misc/lazy-block-quote.txt | 5 -
tests/misc/link-with-parenthesis.html | 1 -
tests/misc/link-with-parenthesis.txt | 1 -
tests/misc/lists.html | 36 -
tests/misc/lists.txt | 31 -
tests/misc/lists2.html | 5 -
tests/misc/lists2.txt | 3 -
tests/misc/lists3.html | 5 -
tests/misc/lists3.txt | 3 -
tests/misc/lists4.html | 8 -
tests/misc/lists4.txt | 5 -
tests/misc/lists5.html | 14 -
tests/misc/lists5.txt | 12 -
tests/misc/markup-inside-p.html | 21 -
tests/misc/markup-inside-p.txt | 21 -
tests/misc/mismatched-tags.html | 11 -
tests/misc/mismatched-tags.txt | 9 -
tests/misc/missing-link-def.html | 1 -
tests/misc/missing-link-def.txt | 4 -
tests/misc/more_comments.html | 7 -
tests/misc/more_comments.txt | 9 -
tests/misc/multi-line-tags.html | 4 -
tests/misc/multi-line-tags.txt | 6 -
tests/misc/multi-paragraph-block-quote.html | 6 -
tests/misc/multi-paragraph-block-quote.txt | 8 -
tests/misc/multi-test.html | 20 -
tests/misc/multi-test.txt | 32 -
tests/misc/multiline-comments.html | 16 -
tests/misc/multiline-comments.txt | 18 -
tests/misc/nested-lists.html | 39 -
tests/misc/nested-lists.txt | 24 -
tests/misc/nested-patterns.html | 7 -
tests/misc/nested-patterns.txt | 7 -
tests/misc/normalize.html | 1 -
tests/misc/normalize.txt | 2 -
tests/misc/numeric-entity.html | 2 -
tests/misc/numeric-entity.txt | 4 -
tests/misc/para-with-hr.html | 3 -
tests/misc/para-with-hr.txt | 4 -
tests/misc/php.html | 11 -
tests/misc/php.txt | 13 -
tests/misc/pre.html | 13 -
tests/misc/pre.txt | 14 -
tests/misc/russian.html | 6 -
tests/misc/russian.txt | 15 -
tests/misc/some-test.html | 66 --
tests/misc/some-test.txt | 57 --
tests/misc/span.html | 6 -
tests/misc/span.txt | 10 -
tests/misc/strong-with-underscores.html | 1 -
tests/misc/strong-with-underscores.txt | 1 -
tests/misc/stronintags.html | 4 -
tests/misc/stronintags.txt | 8 -
tests/misc/tabs-in-lists.html | 42 -
tests/misc/tabs-in-lists.txt | 32 -
tests/misc/two-spaces.html | 21 -
tests/misc/two-spaces.txt | 17 -
tests/misc/uche.html | 3 -
tests/misc/uche.txt | 7 -
tests/misc/underscores.html | 6 -
tests/misc/underscores.txt | 11 -
tests/misc/url_spaces.html | 2 -
tests/misc/url_spaces.txt | 4 -
tests/plugins.py | 113 ---
tests/safe_mode/inline-html-advanced.html | 11 -
tests/safe_mode/inline-html-advanced.txt | 14 -
tests/safe_mode/inline-html-comments.html | 8 -
tests/safe_mode/inline-html-comments.txt | 13 -
tests/safe_mode/inline-html-simple.html | 45 --
tests/safe_mode/inline-html-simple.txt | 69 --
tests/safe_mode/script_tags.html | 28 -
tests/safe_mode/script_tags.txt | 33 -
tests/safe_mode/test.cfg | 2 -
tests/safe_mode/unsafe_urls.html | 20 -
tests/safe_mode/unsafe_urls.txt | 27 -
tests/test_apis.py | 234 ------
tests/util.py | 15 -
452 files changed, 9100 insertions(+), 9100 deletions(-)
create mode 100644 markdown/tests/__init__.py
create mode 100644 markdown/tests/base.py
create mode 100644 markdown/tests/extensions-x-abbr/abbr.html
create mode 100644 markdown/tests/extensions-x-abbr/abbr.txt
create mode 100644 markdown/tests/extensions-x-abbr/test.cfg
create mode 100644 markdown/tests/extensions-x-codehilite/code.html
create mode 100644 markdown/tests/extensions-x-codehilite/code.txt
create mode 100644 markdown/tests/extensions-x-codehilite/test.cfg
create mode 100644 markdown/tests/extensions-x-def_list/loose_def_list.html
create mode 100644 markdown/tests/extensions-x-def_list/loose_def_list.txt
create mode 100644 markdown/tests/extensions-x-def_list/markdown-syntax.html
create mode 100644 markdown/tests/extensions-x-def_list/markdown-syntax.txt
create mode 100644 markdown/tests/extensions-x-def_list/simple_def-lists.html
create mode 100644 markdown/tests/extensions-x-def_list/simple_def-lists.txt
create mode 100644 markdown/tests/extensions-x-def_list/test.cfg
create mode 100644 markdown/tests/extensions-x-footnotes/footnote.html
create mode 100644 markdown/tests/extensions-x-footnotes/footnote.txt
create mode 100644 markdown/tests/extensions-x-footnotes/named_markers.html
create mode 100644 markdown/tests/extensions-x-footnotes/named_markers.txt
create mode 100644 markdown/tests/extensions-x-footnotes/test.cfg
create mode 100644 markdown/tests/extensions-x-tables/tables.html
create mode 100644 markdown/tests/extensions-x-tables/tables.txt
create mode 100644 markdown/tests/extensions-x-tables/test.cfg
create mode 100644 markdown/tests/extensions-x-toc/invalid.html
create mode 100644 markdown/tests/extensions-x-toc/invalid.txt
create mode 100644 markdown/tests/extensions-x-toc/syntax-toc.html
create mode 100644 markdown/tests/extensions-x-toc/syntax-toc.txt
create mode 100644 markdown/tests/extensions-x-toc/test.cfg
create mode 100644 markdown/tests/extensions-x-wikilinks/test.cfg
create mode 100644 markdown/tests/extensions-x-wikilinks/wikilinks.html
create mode 100644 markdown/tests/extensions-x-wikilinks/wikilinks.txt
create mode 100644 markdown/tests/html4/html4.html
create mode 100644 markdown/tests/html4/html4.txt
create mode 100644 markdown/tests/html4/test.cfg
create mode 100644 markdown/tests/markdown-test/amps-and-angle-encoding.html
create mode 100644 markdown/tests/markdown-test/amps-and-angle-encoding.txt
create mode 100644 markdown/tests/markdown-test/angle-links-and-img.html
create mode 100644 markdown/tests/markdown-test/angle-links-and-img.txt
create mode 100644 markdown/tests/markdown-test/auto-links.html
create mode 100644 markdown/tests/markdown-test/auto-links.txt
create mode 100644 markdown/tests/markdown-test/backlash-escapes.html
create mode 100644 markdown/tests/markdown-test/backlash-escapes.txt
create mode 100644 markdown/tests/markdown-test/benchmark.dat
create mode 100644 markdown/tests/markdown-test/blockquotes-with-code-blocks.html
create mode 100644 markdown/tests/markdown-test/blockquotes-with-code-blocks.txt
create mode 100644 markdown/tests/markdown-test/codeblock-in-list.html
create mode 100644 markdown/tests/markdown-test/codeblock-in-list.txt
create mode 100644 markdown/tests/markdown-test/hard-wrapped.html
create mode 100644 markdown/tests/markdown-test/hard-wrapped.txt
create mode 100644 markdown/tests/markdown-test/horizontal-rules.html
create mode 100644 markdown/tests/markdown-test/horizontal-rules.txt
create mode 100644 markdown/tests/markdown-test/inline-html-advanced.html
create mode 100644 markdown/tests/markdown-test/inline-html-advanced.txt
create mode 100644 markdown/tests/markdown-test/inline-html-comments.html
create mode 100644 markdown/tests/markdown-test/inline-html-comments.txt
create mode 100644 markdown/tests/markdown-test/inline-html-simple.html
create mode 100644 markdown/tests/markdown-test/inline-html-simple.txt
create mode 100644 markdown/tests/markdown-test/links-inline.html
create mode 100644 markdown/tests/markdown-test/links-inline.txt
create mode 100644 markdown/tests/markdown-test/links-reference.html
create mode 100644 markdown/tests/markdown-test/links-reference.txt
create mode 100644 markdown/tests/markdown-test/literal-quotes.html
create mode 100644 markdown/tests/markdown-test/literal-quotes.txt
create mode 100644 markdown/tests/markdown-test/markdown-documentation-basics.html
create mode 100644 markdown/tests/markdown-test/markdown-documentation-basics.txt
create mode 100644 markdown/tests/markdown-test/markdown-syntax.html
create mode 100644 markdown/tests/markdown-test/markdown-syntax.txt
create mode 100644 markdown/tests/markdown-test/nested-blockquotes.html
create mode 100644 markdown/tests/markdown-test/nested-blockquotes.txt
create mode 100644 markdown/tests/markdown-test/ordered-and-unordered-list.html
create mode 100644 markdown/tests/markdown-test/ordered-and-unordered-list.txt
create mode 100644 markdown/tests/markdown-test/strong-and-em-together.html
create mode 100644 markdown/tests/markdown-test/strong-and-em-together.txt
create mode 100644 markdown/tests/markdown-test/tabs.html
create mode 100644 markdown/tests/markdown-test/tabs.txt
create mode 100644 markdown/tests/markdown-test/tidyness.html
create mode 100644 markdown/tests/markdown-test/tidyness.txt
create mode 100644 markdown/tests/misc/CRLF_line_ends.html
create mode 100644 markdown/tests/misc/CRLF_line_ends.txt
create mode 100644 markdown/tests/misc/adjacent-headers.html
create mode 100644 markdown/tests/misc/adjacent-headers.txt
create mode 100644 markdown/tests/misc/amp-in-url.html
create mode 100644 markdown/tests/misc/amp-in-url.txt
create mode 100644 markdown/tests/misc/ampersand.html
create mode 100644 markdown/tests/misc/ampersand.txt
create mode 100644 markdown/tests/misc/arabic.html
create mode 100644 markdown/tests/misc/arabic.txt
create mode 100644 markdown/tests/misc/attributes2.html
create mode 100644 markdown/tests/misc/attributes2.txt
create mode 100644 markdown/tests/misc/autolinks_with_asterisks.html
create mode 100644 markdown/tests/misc/autolinks_with_asterisks.txt
create mode 100644 markdown/tests/misc/autolinks_with_asterisks_russian.html
create mode 100644 markdown/tests/misc/autolinks_with_asterisks_russian.txt
create mode 100644 markdown/tests/misc/backtick-escape.html
create mode 100644 markdown/tests/misc/backtick-escape.txt
create mode 100644 markdown/tests/misc/benchmark.dat
create mode 100644 markdown/tests/misc/bidi.html
create mode 100644 markdown/tests/misc/bidi.txt
create mode 100644 markdown/tests/misc/blank-block-quote.html
create mode 100644 markdown/tests/misc/blank-block-quote.txt
create mode 100644 markdown/tests/misc/blockquote-below-paragraph.html
create mode 100644 markdown/tests/misc/blockquote-below-paragraph.txt
create mode 100644 markdown/tests/misc/blockquote-hr.html
create mode 100644 markdown/tests/misc/blockquote-hr.txt
create mode 100644 markdown/tests/misc/blockquote.html
create mode 100644 markdown/tests/misc/blockquote.txt
create mode 100644 markdown/tests/misc/bold_links.html
create mode 100644 markdown/tests/misc/bold_links.txt
create mode 100644 markdown/tests/misc/br.html
create mode 100644 markdown/tests/misc/br.txt
create mode 100644 markdown/tests/misc/bracket_re.html
create mode 100644 markdown/tests/misc/bracket_re.txt
create mode 100644 markdown/tests/misc/code-first-line.html
create mode 100644 markdown/tests/misc/code-first-line.txt
create mode 100644 markdown/tests/misc/comments.html
create mode 100644 markdown/tests/misc/comments.txt
create mode 100644 markdown/tests/misc/div.html
create mode 100644 markdown/tests/misc/div.txt
create mode 100644 markdown/tests/misc/em-around-links.html
create mode 100644 markdown/tests/misc/em-around-links.txt
create mode 100644 markdown/tests/misc/em_strong.html
create mode 100644 markdown/tests/misc/em_strong.txt
create mode 100644 markdown/tests/misc/email.html
create mode 100644 markdown/tests/misc/email.txt
create mode 100644 markdown/tests/misc/funky-list.html
create mode 100644 markdown/tests/misc/funky-list.txt
create mode 100644 markdown/tests/misc/h1.html
create mode 100644 markdown/tests/misc/h1.txt
create mode 100644 markdown/tests/misc/hash.html
create mode 100644 markdown/tests/misc/hash.txt
create mode 100644 markdown/tests/misc/headers.html
create mode 100644 markdown/tests/misc/headers.txt
create mode 100644 markdown/tests/misc/hline.html
create mode 100644 markdown/tests/misc/hline.txt
create mode 100644 markdown/tests/misc/html-comments.html
create mode 100644 markdown/tests/misc/html-comments.txt
create mode 100644 markdown/tests/misc/html.html
create mode 100644 markdown/tests/misc/html.txt
create mode 100644 markdown/tests/misc/image-2.html
create mode 100644 markdown/tests/misc/image-2.txt
create mode 100644 markdown/tests/misc/image.html
create mode 100644 markdown/tests/misc/image.txt
create mode 100644 markdown/tests/misc/image_in_links.html
create mode 100644 markdown/tests/misc/image_in_links.txt
create mode 100644 markdown/tests/misc/inside_html.html
create mode 100644 markdown/tests/misc/inside_html.txt
create mode 100644 markdown/tests/misc/japanese.html
create mode 100644 markdown/tests/misc/japanese.txt
create mode 100644 markdown/tests/misc/lazy-block-quote.html
create mode 100644 markdown/tests/misc/lazy-block-quote.txt
create mode 100644 markdown/tests/misc/link-with-parenthesis.html
create mode 100644 markdown/tests/misc/link-with-parenthesis.txt
create mode 100644 markdown/tests/misc/lists.html
create mode 100644 markdown/tests/misc/lists.txt
create mode 100644 markdown/tests/misc/lists2.html
create mode 100644 markdown/tests/misc/lists2.txt
create mode 100644 markdown/tests/misc/lists3.html
create mode 100644 markdown/tests/misc/lists3.txt
create mode 100644 markdown/tests/misc/lists4.html
create mode 100644 markdown/tests/misc/lists4.txt
create mode 100644 markdown/tests/misc/lists5.html
create mode 100644 markdown/tests/misc/lists5.txt
create mode 100644 markdown/tests/misc/markup-inside-p.html
create mode 100644 markdown/tests/misc/markup-inside-p.txt
create mode 100644 markdown/tests/misc/mismatched-tags.html
create mode 100644 markdown/tests/misc/mismatched-tags.txt
create mode 100644 markdown/tests/misc/missing-link-def.html
create mode 100644 markdown/tests/misc/missing-link-def.txt
create mode 100644 markdown/tests/misc/more_comments.html
create mode 100644 markdown/tests/misc/more_comments.txt
create mode 100644 markdown/tests/misc/multi-line-tags.html
create mode 100644 markdown/tests/misc/multi-line-tags.txt
create mode 100644 markdown/tests/misc/multi-paragraph-block-quote.html
create mode 100644 markdown/tests/misc/multi-paragraph-block-quote.txt
create mode 100644 markdown/tests/misc/multi-test.html
create mode 100644 markdown/tests/misc/multi-test.txt
create mode 100644 markdown/tests/misc/multiline-comments.html
create mode 100644 markdown/tests/misc/multiline-comments.txt
create mode 100644 markdown/tests/misc/nested-lists.html
create mode 100644 markdown/tests/misc/nested-lists.txt
create mode 100644 markdown/tests/misc/nested-patterns.html
create mode 100644 markdown/tests/misc/nested-patterns.txt
create mode 100644 markdown/tests/misc/normalize.html
create mode 100644 markdown/tests/misc/normalize.txt
create mode 100644 markdown/tests/misc/numeric-entity.html
create mode 100644 markdown/tests/misc/numeric-entity.txt
create mode 100644 markdown/tests/misc/para-with-hr.html
create mode 100644 markdown/tests/misc/para-with-hr.txt
create mode 100644 markdown/tests/misc/php.html
create mode 100644 markdown/tests/misc/php.txt
create mode 100644 markdown/tests/misc/pre.html
create mode 100644 markdown/tests/misc/pre.txt
create mode 100644 markdown/tests/misc/russian.html
create mode 100644 markdown/tests/misc/russian.txt
create mode 100644 markdown/tests/misc/some-test.html
create mode 100644 markdown/tests/misc/some-test.txt
create mode 100644 markdown/tests/misc/span.html
create mode 100644 markdown/tests/misc/span.txt
create mode 100644 markdown/tests/misc/strong-with-underscores.html
create mode 100644 markdown/tests/misc/strong-with-underscores.txt
create mode 100644 markdown/tests/misc/stronintags.html
create mode 100644 markdown/tests/misc/stronintags.txt
create mode 100644 markdown/tests/misc/tabs-in-lists.html
create mode 100644 markdown/tests/misc/tabs-in-lists.txt
create mode 100644 markdown/tests/misc/two-spaces.html
create mode 100644 markdown/tests/misc/two-spaces.txt
create mode 100644 markdown/tests/misc/uche.html
create mode 100644 markdown/tests/misc/uche.txt
create mode 100644 markdown/tests/misc/underscores.html
create mode 100644 markdown/tests/misc/underscores.txt
create mode 100644 markdown/tests/misc/url_spaces.html
create mode 100644 markdown/tests/misc/url_spaces.txt
create mode 100644 markdown/tests/plugins.py
create mode 100644 markdown/tests/safe_mode/inline-html-advanced.html
create mode 100644 markdown/tests/safe_mode/inline-html-advanced.txt
create mode 100644 markdown/tests/safe_mode/inline-html-comments.html
create mode 100644 markdown/tests/safe_mode/inline-html-comments.txt
create mode 100644 markdown/tests/safe_mode/inline-html-simple.html
create mode 100644 markdown/tests/safe_mode/inline-html-simple.txt
create mode 100644 markdown/tests/safe_mode/script_tags.html
create mode 100644 markdown/tests/safe_mode/script_tags.txt
create mode 100644 markdown/tests/safe_mode/test.cfg
create mode 100644 markdown/tests/safe_mode/unsafe_urls.html
create mode 100644 markdown/tests/safe_mode/unsafe_urls.txt
create mode 100755 markdown/tests/test_apis.py
create mode 100644 markdown/tests/util.py
delete mode 100644 tests/__init__.py
delete mode 100644 tests/base.py
delete mode 100644 tests/extensions-x-abbr/abbr.html
delete mode 100644 tests/extensions-x-abbr/abbr.txt
delete mode 100644 tests/extensions-x-abbr/test.cfg
delete mode 100644 tests/extensions-x-codehilite/code.html
delete mode 100644 tests/extensions-x-codehilite/code.txt
delete mode 100644 tests/extensions-x-codehilite/test.cfg
delete mode 100644 tests/extensions-x-def_list/loose_def_list.html
delete mode 100644 tests/extensions-x-def_list/loose_def_list.txt
delete mode 100644 tests/extensions-x-def_list/markdown-syntax.html
delete mode 100644 tests/extensions-x-def_list/markdown-syntax.txt
delete mode 100644 tests/extensions-x-def_list/simple_def-lists.html
delete mode 100644 tests/extensions-x-def_list/simple_def-lists.txt
delete mode 100644 tests/extensions-x-def_list/test.cfg
delete mode 100644 tests/extensions-x-footnotes/footnote.html
delete mode 100644 tests/extensions-x-footnotes/footnote.txt
delete mode 100644 tests/extensions-x-footnotes/named_markers.html
delete mode 100644 tests/extensions-x-footnotes/named_markers.txt
delete mode 100644 tests/extensions-x-footnotes/test.cfg
delete mode 100644 tests/extensions-x-tables/tables.html
delete mode 100644 tests/extensions-x-tables/tables.txt
delete mode 100644 tests/extensions-x-tables/test.cfg
delete mode 100644 tests/extensions-x-toc/invalid.html
delete mode 100644 tests/extensions-x-toc/invalid.txt
delete mode 100644 tests/extensions-x-toc/syntax-toc.html
delete mode 100644 tests/extensions-x-toc/syntax-toc.txt
delete mode 100644 tests/extensions-x-toc/test.cfg
delete mode 100644 tests/extensions-x-wikilinks/test.cfg
delete mode 100644 tests/extensions-x-wikilinks/wikilinks.html
delete mode 100644 tests/extensions-x-wikilinks/wikilinks.txt
delete mode 100644 tests/html4/html4.html
delete mode 100644 tests/html4/html4.txt
delete mode 100644 tests/html4/test.cfg
delete mode 100644 tests/markdown-test/amps-and-angle-encoding.html
delete mode 100644 tests/markdown-test/amps-and-angle-encoding.txt
delete mode 100644 tests/markdown-test/angle-links-and-img.html
delete mode 100644 tests/markdown-test/angle-links-and-img.txt
delete mode 100644 tests/markdown-test/auto-links.html
delete mode 100644 tests/markdown-test/auto-links.txt
delete mode 100644 tests/markdown-test/backlash-escapes.html
delete mode 100644 tests/markdown-test/backlash-escapes.txt
delete mode 100644 tests/markdown-test/benchmark.dat
delete mode 100644 tests/markdown-test/blockquotes-with-code-blocks.html
delete mode 100644 tests/markdown-test/blockquotes-with-code-blocks.txt
delete mode 100644 tests/markdown-test/codeblock-in-list.html
delete mode 100644 tests/markdown-test/codeblock-in-list.txt
delete mode 100644 tests/markdown-test/hard-wrapped.html
delete mode 100644 tests/markdown-test/hard-wrapped.txt
delete mode 100644 tests/markdown-test/horizontal-rules.html
delete mode 100644 tests/markdown-test/horizontal-rules.txt
delete mode 100644 tests/markdown-test/inline-html-advanced.html
delete mode 100644 tests/markdown-test/inline-html-advanced.txt
delete mode 100644 tests/markdown-test/inline-html-comments.html
delete mode 100644 tests/markdown-test/inline-html-comments.txt
delete mode 100644 tests/markdown-test/inline-html-simple.html
delete mode 100644 tests/markdown-test/inline-html-simple.txt
delete mode 100644 tests/markdown-test/links-inline.html
delete mode 100644 tests/markdown-test/links-inline.txt
delete mode 100644 tests/markdown-test/links-reference.html
delete mode 100644 tests/markdown-test/links-reference.txt
delete mode 100644 tests/markdown-test/literal-quotes.html
delete mode 100644 tests/markdown-test/literal-quotes.txt
delete mode 100644 tests/markdown-test/markdown-documentation-basics.html
delete mode 100644 tests/markdown-test/markdown-documentation-basics.txt
delete mode 100644 tests/markdown-test/markdown-syntax.html
delete mode 100644 tests/markdown-test/markdown-syntax.txt
delete mode 100644 tests/markdown-test/nested-blockquotes.html
delete mode 100644 tests/markdown-test/nested-blockquotes.txt
delete mode 100644 tests/markdown-test/ordered-and-unordered-list.html
delete mode 100644 tests/markdown-test/ordered-and-unordered-list.txt
delete mode 100644 tests/markdown-test/strong-and-em-together.html
delete mode 100644 tests/markdown-test/strong-and-em-together.txt
delete mode 100644 tests/markdown-test/tabs.html
delete mode 100644 tests/markdown-test/tabs.txt
delete mode 100644 tests/markdown-test/tidyness.html
delete mode 100644 tests/markdown-test/tidyness.txt
delete mode 100644 tests/misc/CRLF_line_ends.html
delete mode 100644 tests/misc/CRLF_line_ends.txt
delete mode 100644 tests/misc/adjacent-headers.html
delete mode 100644 tests/misc/adjacent-headers.txt
delete mode 100644 tests/misc/amp-in-url.html
delete mode 100644 tests/misc/amp-in-url.txt
delete mode 100644 tests/misc/ampersand.html
delete mode 100644 tests/misc/ampersand.txt
delete mode 100644 tests/misc/arabic.html
delete mode 100644 tests/misc/arabic.txt
delete mode 100644 tests/misc/attributes2.html
delete mode 100644 tests/misc/attributes2.txt
delete mode 100644 tests/misc/autolinks_with_asterisks.html
delete mode 100644 tests/misc/autolinks_with_asterisks.txt
delete mode 100644 tests/misc/autolinks_with_asterisks_russian.html
delete mode 100644 tests/misc/autolinks_with_asterisks_russian.txt
delete mode 100644 tests/misc/backtick-escape.html
delete mode 100644 tests/misc/backtick-escape.txt
delete mode 100644 tests/misc/benchmark.dat
delete mode 100644 tests/misc/bidi.html
delete mode 100644 tests/misc/bidi.txt
delete mode 100644 tests/misc/blank-block-quote.html
delete mode 100644 tests/misc/blank-block-quote.txt
delete mode 100644 tests/misc/blockquote-below-paragraph.html
delete mode 100644 tests/misc/blockquote-below-paragraph.txt
delete mode 100644 tests/misc/blockquote-hr.html
delete mode 100644 tests/misc/blockquote-hr.txt
delete mode 100644 tests/misc/blockquote.html
delete mode 100644 tests/misc/blockquote.txt
delete mode 100644 tests/misc/bold_links.html
delete mode 100644 tests/misc/bold_links.txt
delete mode 100644 tests/misc/br.html
delete mode 100644 tests/misc/br.txt
delete mode 100644 tests/misc/bracket_re.html
delete mode 100644 tests/misc/bracket_re.txt
delete mode 100644 tests/misc/code-first-line.html
delete mode 100644 tests/misc/code-first-line.txt
delete mode 100644 tests/misc/comments.html
delete mode 100644 tests/misc/comments.txt
delete mode 100644 tests/misc/div.html
delete mode 100644 tests/misc/div.txt
delete mode 100644 tests/misc/em-around-links.html
delete mode 100644 tests/misc/em-around-links.txt
delete mode 100644 tests/misc/em_strong.html
delete mode 100644 tests/misc/em_strong.txt
delete mode 100644 tests/misc/email.html
delete mode 100644 tests/misc/email.txt
delete mode 100644 tests/misc/funky-list.html
delete mode 100644 tests/misc/funky-list.txt
delete mode 100644 tests/misc/h1.html
delete mode 100644 tests/misc/h1.txt
delete mode 100644 tests/misc/hash.html
delete mode 100644 tests/misc/hash.txt
delete mode 100644 tests/misc/headers.html
delete mode 100644 tests/misc/headers.txt
delete mode 100644 tests/misc/hline.html
delete mode 100644 tests/misc/hline.txt
delete mode 100644 tests/misc/html-comments.html
delete mode 100644 tests/misc/html-comments.txt
delete mode 100644 tests/misc/html.html
delete mode 100644 tests/misc/html.txt
delete mode 100644 tests/misc/image-2.html
delete mode 100644 tests/misc/image-2.txt
delete mode 100644 tests/misc/image.html
delete mode 100644 tests/misc/image.txt
delete mode 100644 tests/misc/image_in_links.html
delete mode 100644 tests/misc/image_in_links.txt
delete mode 100644 tests/misc/inside_html.html
delete mode 100644 tests/misc/inside_html.txt
delete mode 100644 tests/misc/japanese.html
delete mode 100644 tests/misc/japanese.txt
delete mode 100644 tests/misc/lazy-block-quote.html
delete mode 100644 tests/misc/lazy-block-quote.txt
delete mode 100644 tests/misc/link-with-parenthesis.html
delete mode 100644 tests/misc/link-with-parenthesis.txt
delete mode 100644 tests/misc/lists.html
delete mode 100644 tests/misc/lists.txt
delete mode 100644 tests/misc/lists2.html
delete mode 100644 tests/misc/lists2.txt
delete mode 100644 tests/misc/lists3.html
delete mode 100644 tests/misc/lists3.txt
delete mode 100644 tests/misc/lists4.html
delete mode 100644 tests/misc/lists4.txt
delete mode 100644 tests/misc/lists5.html
delete mode 100644 tests/misc/lists5.txt
delete mode 100644 tests/misc/markup-inside-p.html
delete mode 100644 tests/misc/markup-inside-p.txt
delete mode 100644 tests/misc/mismatched-tags.html
delete mode 100644 tests/misc/mismatched-tags.txt
delete mode 100644 tests/misc/missing-link-def.html
delete mode 100644 tests/misc/missing-link-def.txt
delete mode 100644 tests/misc/more_comments.html
delete mode 100644 tests/misc/more_comments.txt
delete mode 100644 tests/misc/multi-line-tags.html
delete mode 100644 tests/misc/multi-line-tags.txt
delete mode 100644 tests/misc/multi-paragraph-block-quote.html
delete mode 100644 tests/misc/multi-paragraph-block-quote.txt
delete mode 100644 tests/misc/multi-test.html
delete mode 100644 tests/misc/multi-test.txt
delete mode 100644 tests/misc/multiline-comments.html
delete mode 100644 tests/misc/multiline-comments.txt
delete mode 100644 tests/misc/nested-lists.html
delete mode 100644 tests/misc/nested-lists.txt
delete mode 100644 tests/misc/nested-patterns.html
delete mode 100644 tests/misc/nested-patterns.txt
delete mode 100644 tests/misc/normalize.html
delete mode 100644 tests/misc/normalize.txt
delete mode 100644 tests/misc/numeric-entity.html
delete mode 100644 tests/misc/numeric-entity.txt
delete mode 100644 tests/misc/para-with-hr.html
delete mode 100644 tests/misc/para-with-hr.txt
delete mode 100644 tests/misc/php.html
delete mode 100644 tests/misc/php.txt
delete mode 100644 tests/misc/pre.html
delete mode 100644 tests/misc/pre.txt
delete mode 100644 tests/misc/russian.html
delete mode 100644 tests/misc/russian.txt
delete mode 100644 tests/misc/some-test.html
delete mode 100644 tests/misc/some-test.txt
delete mode 100644 tests/misc/span.html
delete mode 100644 tests/misc/span.txt
delete mode 100644 tests/misc/strong-with-underscores.html
delete mode 100644 tests/misc/strong-with-underscores.txt
delete mode 100644 tests/misc/stronintags.html
delete mode 100644 tests/misc/stronintags.txt
delete mode 100644 tests/misc/tabs-in-lists.html
delete mode 100644 tests/misc/tabs-in-lists.txt
delete mode 100644 tests/misc/two-spaces.html
delete mode 100644 tests/misc/two-spaces.txt
delete mode 100644 tests/misc/uche.html
delete mode 100644 tests/misc/uche.txt
delete mode 100644 tests/misc/underscores.html
delete mode 100644 tests/misc/underscores.txt
delete mode 100644 tests/misc/url_spaces.html
delete mode 100644 tests/misc/url_spaces.txt
delete mode 100644 tests/plugins.py
delete mode 100644 tests/safe_mode/inline-html-advanced.html
delete mode 100644 tests/safe_mode/inline-html-advanced.txt
delete mode 100644 tests/safe_mode/inline-html-comments.html
delete mode 100644 tests/safe_mode/inline-html-comments.txt
delete mode 100644 tests/safe_mode/inline-html-simple.html
delete mode 100644 tests/safe_mode/inline-html-simple.txt
delete mode 100644 tests/safe_mode/script_tags.html
delete mode 100644 tests/safe_mode/script_tags.txt
delete mode 100644 tests/safe_mode/test.cfg
delete mode 100644 tests/safe_mode/unsafe_urls.html
delete mode 100644 tests/safe_mode/unsafe_urls.txt
delete mode 100755 tests/test_apis.py
delete mode 100644 tests/util.py
diff --git a/markdown/tests/__init__.py b/markdown/tests/__init__.py
new file mode 100644
index 0000000..63ddf5b
--- /dev/null
+++ b/markdown/tests/__init__.py
@@ -0,0 +1,44 @@
+import os
+import markdown
+import codecs
+import difflib
+import nose
+import util
+from plugins import MdSyntaxError, HtmlOutput, MdSyntaxErrorPlugin
+from test_apis import *
+
+test_dir = os.path.abspath(os.path.dirname(__file__))
+
+def normalize(text):
+ return ['%s\n' % l for l in text.strip().split('\n')]
+
+def check_syntax(file, config):
+ input_file = file + ".txt"
+ input = codecs.open(input_file, encoding="utf-8").read()
+ output_file = file + ".html"
+ expected_output = codecs.open(output_file, encoding="utf-8").read()
+ output = normalize(markdown.markdown(input,
+ config.get('DEFAULT', 'extensions'),
+ config.get('DEFAULT', 'safe_mode'),
+ config.get('DEFAULT', 'output_format')))
+ diff = [l for l in difflib.unified_diff(normalize(expected_output),
+ output, output_file,
+ 'actual_output.html', n=3)]
+ if diff:
+ raise util.MdSyntaxError('Output from "%s" failed to match expected '
+ 'output.\n\n%s' % (input_file, ''.join(diff)))
+
+def test_markdown_syntax():
+ for dir_name, sub_dirs, files in os.walk(test_dir):
+ # Get dir specific config settings.
+ config = util.CustomConfigParser({'extensions': '',
+ 'safe_mode': False,
+ 'output_format': 'xhtml1'})
+ config.read(os.path.join(dir_name, 'test.cfg'))
+ # Loop through files and generate tests.
+ for file in files:
+ root, ext = os.path.splitext(file)
+ if ext == '.txt':
+ yield check_syntax, os.path.join(dir_name, root), config
+
+nose.main(addplugins=[HtmlOutput(), MdSyntaxErrorPlugin()])
diff --git a/markdown/tests/base.py b/markdown/tests/base.py
new file mode 100644
index 0000000..9e70996
--- /dev/null
+++ b/markdown/tests/base.py
@@ -0,0 +1,62 @@
+import os, codecs
+import markdown
+from nose.tools import assert_equal
+import difflib
+from plugins import MdSyntaxError
+
+class SyntaxBase:
+ """
+ Generator that steps through all files in a dir and runs each text file
+ (*.txt) as a seperate unit test.
+
+ Each subclass of SyntaxBase should define `dir` as a string containing the
+ name of the directory which holds the test files. For example:
+
+ dir = "path/to/mytests"
+
+ A subclass may redefine the `setUp` method to create a custom `Markdown`
+ instance specific to that batch of tests.
+
+ """
+
+ dir = ""
+
+ def __init__(self):
+ self.files = [x.replace(".txt", "")
+ for x in os.listdir(self.dir) if x.endswith(".txt")]
+
+ def setUp(self):
+ """
+ Create Markdown instance.
+
+ Override this method to create a custom `Markdown` instance assigned to
+ `self.md`. For example:
+
+ self.md = markdown.Markdown(extensions=["footnotes"], safe_mode="replace")
+
+ """
+ self.md = markdown.Markdown()
+
+ def tearDown(self):
+ """ tearDown is not implemented. """
+ pass
+
+ def test_syntax(self):
+ for file in self.files:
+ yield self.check_syntax, file
+
+ def check_syntax(self, file):
+ input_file = os.path.join(self.dir, file + ".txt")
+ input = codecs.open(input_file, encoding="utf-8").read()
+ output_file = os.path.join(self.dir, file + ".html")
+ expected_output = codecs.open(output_file, encoding="utf-8").read()
+ output = self.normalize(self.md.convert(input))
+ diff = [l for l in difflib.unified_diff(self.normalize(expected_output),
+ output, output_file,
+ 'actual_output.html', n=3)]
+ if diff:
+ #assert False,
+ raise MdSyntaxError('Output from "%s" failed to match expected output.\n\n%s' % (input_file, ''.join(diff)))
+
+ def normalize(self, text):
+ return ['%s\n' % l for l in text.strip().split('\n')]
diff --git a/markdown/tests/extensions-x-abbr/abbr.html b/markdown/tests/extensions-x-abbr/abbr.html
new file mode 100644
index 0000000..456524e
--- /dev/null
+++ b/markdown/tests/extensions-x-abbr/abbr.html
@@ -0,0 +1,4 @@
+An ABBR: "REF".
+ref and REFERENCE should be ignored.
+The HTML specification
+is maintained by the W3C.
\ No newline at end of file
diff --git a/markdown/tests/extensions-x-abbr/abbr.txt b/markdown/tests/extensions-x-abbr/abbr.txt
new file mode 100644
index 0000000..991bf15
--- /dev/null
+++ b/markdown/tests/extensions-x-abbr/abbr.txt
@@ -0,0 +1,13 @@
+An ABBR: "REF".
+ref and REFERENCE should be ignored.
+
+*[REF]: Reference
+*[ABBR]: This gets overriden by the next one.
+*[ABBR]: Abbreviation
+
+The HTML specification
+is maintained by the W3C.
+
+*[HTML]: Hyper Text Markup Language
+*[W3C]: World Wide Web Consortium
+
diff --git a/markdown/tests/extensions-x-abbr/test.cfg b/markdown/tests/extensions-x-abbr/test.cfg
new file mode 100644
index 0000000..32d437f
--- /dev/null
+++ b/markdown/tests/extensions-x-abbr/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=abbr
diff --git a/markdown/tests/extensions-x-codehilite/code.html b/markdown/tests/extensions-x-codehilite/code.html
new file mode 100644
index 0000000..6a8ee91
--- /dev/null
+++ b/markdown/tests/extensions-x-codehilite/code.html
@@ -0,0 +1,16 @@
+Some text
+1
+2
+3
+4
+5
+6
def __init__ (self, pattern) :
+ self.pattern = pattern
+ self.compiled_re = re.compile("^(.*)%s(.*)$" % pattern, re.DOTALL)
+
+def getCompiledRegExp (self) :
+ return self.compiled_re
+
+
+
+More text
\ No newline at end of file
diff --git a/markdown/tests/extensions-x-codehilite/code.txt b/markdown/tests/extensions-x-codehilite/code.txt
new file mode 100644
index 0000000..6c62e6a
--- /dev/null
+++ b/markdown/tests/extensions-x-codehilite/code.txt
@@ -0,0 +1,12 @@
+
+Some text
+
+ #!python
+ def __init__ (self, pattern) :
+ self.pattern = pattern
+ self.compiled_re = re.compile("^(.*)%s(.*)$" % pattern, re.DOTALL)
+
+ def getCompiledRegExp (self) :
+ return self.compiled_re
+
+More text
\ No newline at end of file
diff --git a/markdown/tests/extensions-x-codehilite/test.cfg b/markdown/tests/extensions-x-codehilite/test.cfg
new file mode 100644
index 0000000..6ed10a2
--- /dev/null
+++ b/markdown/tests/extensions-x-codehilite/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=codehilite
diff --git a/markdown/tests/extensions-x-def_list/loose_def_list.html b/markdown/tests/extensions-x-def_list/loose_def_list.html
new file mode 100644
index 0000000..98fdec8
--- /dev/null
+++ b/markdown/tests/extensions-x-def_list/loose_def_list.html
@@ -0,0 +1,21 @@
+some text
+
+- term 1
+-
+
def 1-1
+
+-
+
def 2-2
+
+- term 2
+- term 3
+-
+
def 2-1
+line 2 of def 2-1
+
+-
+
def 2-2
+par 2 of def2-2
+
+
+more text
\ No newline at end of file
diff --git a/markdown/tests/extensions-x-def_list/loose_def_list.txt b/markdown/tests/extensions-x-def_list/loose_def_list.txt
new file mode 100644
index 0000000..24cd6a4
--- /dev/null
+++ b/markdown/tests/extensions-x-def_list/loose_def_list.txt
@@ -0,0 +1,20 @@
+some text
+
+term 1
+
+: def 1-1
+
+: def 2-2
+
+term 2
+term 3
+
+: def 2-1
+ line 2 of def 2-1
+
+: def 2-2
+
+ par 2 of def2-2
+
+more text
+
diff --git a/markdown/tests/extensions-x-def_list/markdown-syntax.html b/markdown/tests/extensions-x-def_list/markdown-syntax.html
new file mode 100644
index 0000000..038c9d1
--- /dev/null
+++ b/markdown/tests/extensions-x-def_list/markdown-syntax.html
@@ -0,0 +1,728 @@
+Markdown: Syntax
+
+
+
+- Overview
+
+- Block Elements
+
+- Span Elements
+
+- Miscellaneous
+
+
+Note: This document is itself written using Markdown; you
+can see the source for it by adding '.text' to the URL.
+
+Overview
+
+Philosophy
+
+Markdown is intended to be as easy-to-read and easy-to-write as is feasible.
+Readability, however, is emphasized above all else. A Markdown-formatted
+document should be publishable as-is, as plain text, without looking
+like it's been marked up with tags or formatting instructions. While
+Markdown's syntax has been influenced by several existing text-to-HTML
+filters -- including Setext, atx, Textile, reStructuredText,
+Grutatext, and EtText -- the single biggest source of
+inspiration for Markdown's syntax is the format of plain text email.
+To this end, Markdown's syntax is comprised entirely of punctuation
+characters, which punctuation characters have been carefully chosen so
+as to look like what they mean. E.g., asterisks around a word actually
+look like *emphasis*. Markdown lists look like, well, lists. Even
+blockquotes look like quoted passages of text, assuming you've ever
+used email.
+Inline HTML
+
+Markdown's syntax is intended for one purpose: to be used as a
+format for writing for the web.
+Markdown is not a replacement for HTML, or even close to it. Its
+syntax is very small, corresponding only to a very small subset of
+HTML tags. The idea is not to create a syntax that makes it easier
+to insert HTML tags. In my opinion, HTML tags are already easy to
+insert. The idea for Markdown is to make it easy to read, write, and
+edit prose. HTML is a publishing format; Markdown is a writing
+format. Thus, Markdown's formatting syntax only addresses issues that
+can be conveyed in plain text.
+For any markup that is not covered by Markdown's syntax, you simply
+use HTML itself. There's no need to preface it or delimit it to
+indicate that you're switching from Markdown to HTML; you just use
+the tags.
+The only restrictions are that block-level HTML elements -- e.g. <div>
,
+<table>
, <pre>
, <p>
, etc. -- must be separated from surrounding
+content by blank lines, and the start and end tags of the block should
+not be indented with tabs or spaces. Markdown is smart enough not
+to add extra (unwanted) <p>
tags around HTML block-level tags.
+For example, to add an HTML table to a Markdown article:
+This is a regular paragraph.
+
+<table>
+ <tr>
+ <td>Foo</td>
+ </tr>
+</table>
+
+This is another regular paragraph.
+
+Note that Markdown formatting syntax is not processed within block-level
+HTML tags. E.g., you can't use Markdown-style *emphasis*
inside an
+HTML block.
+Span-level HTML tags -- e.g. <span>
, <cite>
, or <del>
-- can be
+used anywhere in a Markdown paragraph, list item, or header. If you
+want, you can even use HTML tags instead of Markdown formatting; e.g. if
+you'd prefer to use HTML <a>
or <img>
tags instead of Markdown's
+link or image syntax, go right ahead.
+Unlike block-level HTML tags, Markdown syntax is processed within
+span-level tags.
+Automatic Escaping for Special Characters
+
+In HTML, there are two characters that demand special treatment: <
+and &
. Left angle brackets are used to start tags; ampersands are
+used to denote HTML entities. If you want to use them as literal
+characters, you must escape them as entities, e.g. <
, and
+&
.
+Ampersands in particular are bedeviling for web writers. If you want to
+write about 'AT&T', you need to write 'AT&T
'. You even need to
+escape ampersands within URLs. Thus, if you want to link to:
+http://images.google.com/images?num=30&q=larry+bird
+
+you need to encode the URL as:
+http://images.google.com/images?num=30&q=larry+bird
+
+in your anchor tag href
attribute. Needless to say, this is easy to
+forget, and is probably the single most common source of HTML validation
+errors in otherwise well-marked-up web sites.
+Markdown allows you to use these characters naturally, taking care of
+all the necessary escaping for you. If you use an ampersand as part of
+an HTML entity, it remains unchanged; otherwise it will be translated
+into &
.
+So, if you want to include a copyright symbol in your article, you can write:
+©
+
+and Markdown will leave it alone. But if you write:
+AT&T
+
+Markdown will translate it to:
+AT&T
+
+Similarly, because Markdown supports inline HTML, if you use
+angle brackets as delimiters for HTML tags, Markdown will treat them as
+such. But if you write:
+4 < 5
+
+Markdown will translate it to:
+4 < 5
+
+However, inside Markdown code spans and blocks, angle brackets and
+ampersands are always encoded automatically. This makes it easy to use
+Markdown to write about HTML code. (As opposed to raw HTML, which is a
+terrible format for writing about HTML syntax, because every single <
+and &
in your example code needs to be escaped.)
+
+Block Elements
+
+Paragraphs and Line Breaks
+
+A paragraph is simply one or more consecutive lines of text, separated
+by one or more blank lines. (A blank line is any line that looks like a
+blank line -- a line containing nothing but spaces or tabs is considered
+blank.) Normal paragraphs should not be intended with spaces or tabs.
+The implication of the "one or more consecutive lines of text" rule is
+that Markdown supports "hard-wrapped" text paragraphs. This differs
+significantly from most other text-to-HTML formatters (including Movable
+Type's "Convert Line Breaks" option) which translate every line break
+character in a paragraph into a <br />
tag.
+When you do want to insert a <br />
break tag using Markdown, you
+end a line with two or more spaces, then type return.
+Yes, this takes a tad more effort to create a <br />
, but a simplistic
+"every line break is a <br />
" rule wouldn't work for Markdown.
+Markdown's email-style blockquoting and multi-paragraph list items
+work best -- and look better -- when you format them with hard breaks.
+Headers
+
+Markdown supports two styles of headers, Setext and atx.
+Setext-style headers are "underlined" using equal signs (for first-level
+headers) and dashes (for second-level headers). For example:
+This is an H1
+=============
+
+This is an H2
+-------------
+
+Any number of underlining =
's or -
's will work.
+Atx-style headers use 1-6 hash characters at the start of the line,
+corresponding to header levels 1-6. For example:
+# This is an H1
+
+## This is an H2
+
+###### This is an H6
+
+Optionally, you may "close" atx-style headers. This is purely
+cosmetic -- you can use this if you think it looks better. The
+closing hashes don't even need to match the number of hashes
+used to open the header. (The number of opening hashes
+determines the header level.) :
+# This is an H1 #
+
+## This is an H2 ##
+
+### This is an H3 ######
+
+Blockquotes
+
+Markdown uses email-style >
characters for blockquoting. If you're
+familiar with quoting passages of text in an email message, then you
+know how to create a blockquote in Markdown. It looks best if you hard
+wrap the text and put a >
before every line:
+> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+>
+> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
+> id sem consectetuer libero luctus adipiscing.
+
+Markdown allows you to be lazy and only put the >
before the first
+line of a hard-wrapped paragraph:
+> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+
+> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
+id sem consectetuer libero luctus adipiscing.
+
+Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
+adding additional levels of >
:
+> This is the first level of quoting.
+>
+> > This is nested blockquote.
+>
+> Back to the first level.
+
+Blockquotes can contain other Markdown elements, including headers, lists,
+and code blocks:
+> ## This is a header.
+>
+> 1. This is the first list item.
+> 2. This is the second list item.
+>
+> Here's some example code:
+>
+> return shell_exec("echo $input | $markdown_script");
+
+Any decent text editor should make email-style quoting easy. For
+example, with BBEdit, you can make a selection and choose Increase
+Quote Level from the Text menu.
+Lists
+
+Markdown supports ordered (numbered) and unordered (bulleted) lists.
+Unordered lists use asterisks, pluses, and hyphens -- interchangably
+-- as list markers:
+* Red
+* Green
+* Blue
+
+is equivalent to:
++ Red
++ Green
++ Blue
+
+and:
+- Red
+- Green
+- Blue
+
+Ordered lists use numbers followed by periods:
+1. Bird
+2. McHale
+3. Parish
+
+It's important to note that the actual numbers you use to mark the
+list have no effect on the HTML output Markdown produces. The HTML
+Markdown produces from the above list is:
+<ol>
+<li>Bird</li>
+<li>McHale</li>
+<li>Parish</li>
+</ol>
+
+If you instead wrote the list in Markdown like this:
+1. Bird
+1. McHale
+1. Parish
+
+or even:
+3. Bird
+1. McHale
+8. Parish
+
+you'd get the exact same HTML output. The point is, if you want to,
+you can use ordinal numbers in your ordered Markdown lists, so that
+the numbers in your source match the numbers in your published HTML.
+But if you want to be lazy, you don't have to.
+If you do use lazy list numbering, however, you should still start the
+list with the number 1. At some point in the future, Markdown may support
+starting ordered lists at an arbitrary number.
+List markers typically start at the left margin, but may be indented by
+up to three spaces. List markers must be followed by one or more spaces
+or a tab.
+To make lists look nice, you can wrap items with hanging indents:
+* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
+ viverra nec, fringilla in, laoreet vitae, risus.
+* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
+ Suspendisse id sem consectetuer libero luctus adipiscing.
+
+But if you want to be lazy, you don't have to:
+* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
+Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
+viverra nec, fringilla in, laoreet vitae, risus.
+* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
+Suspendisse id sem consectetuer libero luctus adipiscing.
+
+If list items are separated by blank lines, Markdown will wrap the
+items in <p>
tags in the HTML output. For example, this input:
+* Bird
+* Magic
+
+will turn into:
+<ul>
+<li>Bird</li>
+<li>Magic</li>
+</ul>
+
+But this:
+* Bird
+
+* Magic
+
+will turn into:
+<ul>
+<li><p>Bird</p></li>
+<li><p>Magic</p></li>
+</ul>
+
+List items may consist of multiple paragraphs. Each subsequent
+paragraph in a list item must be intended by either 4 spaces
+or one tab:
+1. This is a list item with two paragraphs. Lorem ipsum dolor
+ sit amet, consectetuer adipiscing elit. Aliquam hendrerit
+ mi posuere lectus.
+
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet
+ vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
+ sit amet velit.
+
+2. Suspendisse id sem consectetuer libero luctus adipiscing.
+
+It looks nice if you indent every line of the subsequent
+paragraphs, but here again, Markdown will allow you to be
+lazy:
+* This is a list item with two paragraphs.
+
+ This is the second paragraph in the list item. You're
+only required to indent the first line. Lorem ipsum dolor
+sit amet, consectetuer adipiscing elit.
+
+* Another item in the same list.
+
+To put a blockquote within a list item, the blockquote's >
+delimiters need to be indented:
+* A list item with a blockquote:
+
+ > This is a blockquote
+ > inside a list item.
+
+To put a code block within a list item, the code block needs
+to be indented twice -- 8 spaces or two tabs:
+* A list item with a code block:
+
+ <code goes here>
+
+It's worth noting that it's possible to trigger an ordered list by
+accident, by writing something like this:
+1986. What a great season.
+
+In other words, a number-period-space sequence at the beginning of a
+line. To avoid this, you can backslash-escape the period:
+1986\. What a great season.
+
+Code Blocks
+
+Pre-formatted code blocks are used for writing about programming or
+markup source code. Rather than forming normal paragraphs, the lines
+of a code block are interpreted literally. Markdown wraps a code block
+in both <pre>
and <code>
tags.
+To produce a code block in Markdown, simply indent every line of the
+block by at least 4 spaces or 1 tab. For example, given this input:
+This is a normal paragraph:
+
+ This is a code block.
+
+Markdown will generate:
+<p>This is a normal paragraph:</p>
+
+<pre><code>This is a code block.
+</code></pre>
+
+One level of indentation -- 4 spaces or 1 tab -- is removed from each
+line of the code block. For example, this:
+Here is an example of AppleScript:
+
+ tell application "Foo"
+ beep
+ end tell
+
+will turn into:
+<p>Here is an example of AppleScript:</p>
+
+<pre><code>tell application "Foo"
+ beep
+end tell
+</code></pre>
+
+A code block continues until it reaches a line that is not indented
+(or the end of the article).
+Within a code block, ampersands (&
) and angle brackets (<
and >
)
+are automatically converted into HTML entities. This makes it very
+easy to include example HTML source code using Markdown -- just paste
+it and indent it, and Markdown will handle the hassle of encoding the
+ampersands and angle brackets. For example, this:
+ <div class="footer">
+ © 2004 Foo Corporation
+ </div>
+
+will turn into:
+<pre><code><div class="footer">
+ &copy; 2004 Foo Corporation
+</div>
+</code></pre>
+
+Regular Markdown syntax is not processed within code blocks. E.g.,
+asterisks are just literal asterisks within a code block. This means
+it's also easy to use Markdown to write about Markdown's own syntax.
+Horizontal Rules
+
+You can produce a horizontal rule tag (<hr />
) by placing three or
+more hyphens, asterisks, or underscores on a line by themselves. If you
+wish, you may use spaces between the hyphens or asterisks. Each of the
+following lines will produce a horizontal rule:
+* * *
+
+***
+
+*****
+
+- - -
+
+---------------------------------------
+
+_ _ _
+
+
+Span Elements
+
+Links
+
+Markdown supports two style of links: inline and reference.
+In both styles, the link text is delimited by [square brackets].
+To create an inline link, use a set of regular parentheses immediately
+after the link text's closing square bracket. Inside the parentheses,
+put the URL where you want the link to point, along with an optional
+title for the link, surrounded in quotes. For example:
+This is [an example](http://example.com/ "Title") inline link.
+
+[This link](http://example.net/) has no title attribute.
+
+Will produce:
+<p>This is <a href="http://example.com/" title="Title">
+an example</a> inline link.</p>
+
+<p><a href="http://example.net/">This link</a> has no
+title attribute.</p>
+
+If you're referring to a local resource on the same server, you can
+use relative paths:
+See my [About](/about/) page for details.
+
+Reference-style links use a second set of square brackets, inside
+which you place a label of your choosing to identify the link:
+This is [an example][id] reference-style link.
+
+You can optionally use a space to separate the sets of brackets:
+This is [an example] [id] reference-style link.
+
+Then, anywhere in the document, you define your link label like this,
+on a line by itself:
+[id]: http://example.com/ "Optional Title Here"
+
+That is:
+
+- Square brackets containing the link identifier (optionally
+ indented from the left margin using up to three spaces);
+- followed by a colon;
+- followed by one or more spaces (or tabs);
+- followed by the URL for the link;
+- optionally followed by a title attribute for the link, enclosed
+ in double or single quotes.
+
+The link URL may, optionally, be surrounded by angle brackets:
+[id]: <http://example.com/> "Optional Title Here"
+
+You can put the title attribute on the next line and use extra spaces
+or tabs for padding, which tends to look better with longer URLs:
+[id]: http://example.com/longish/path/to/resource/here
+ "Optional Title Here"
+
+Link definitions are only used for creating links during Markdown
+processing, and are stripped from your document in the HTML output.
+Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are not case sensitive. E.g. these two links:
+[link text][a]
+[link text][A]
+
+are equivalent.
+The implicit link name shortcut allows you to omit the name of the
+link, in which case the link text itself is used as the name.
+Just use an empty set of square brackets -- e.g., to link the word
+"Google" to the google.com web site, you could simply write:
+[Google][]
+
+And then define the link:
+[Google]: http://google.com/
+
+Because link names may contain spaces, this shortcut even works for
+multiple words in the link text:
+Visit [Daring Fireball][] for more information.
+
+And then define the link:
+[Daring Fireball]: http://daringfireball.net/
+
+Link definitions can be placed anywhere in your Markdown document. I
+tend to put them immediately after each paragraph in which they're
+used, but if you want, you can put them all at the end of your
+document, sort of like footnotes.
+Here's an example of reference links in action:
+I get 10 times more traffic from [Google] [1] than from
+[Yahoo] [2] or [MSN] [3].
+
+ [1]: http://google.com/ "Google"
+ [2]: http://search.yahoo.com/ "Yahoo Search"
+ [3]: http://search.msn.com/ "MSN Search"
+
+Using the implicit link name shortcut, you could instead write:
+I get 10 times more traffic from [Google][] than from
+[Yahoo][] or [MSN][].
+
+ [google]: http://google.com/ "Google"
+ [yahoo]: http://search.yahoo.com/ "Yahoo Search"
+ [msn]: http://search.msn.com/ "MSN Search"
+
+Both of the above examples will produce the following HTML output:
+<p>I get 10 times more traffic from <a href="http://google.com/"
+title="Google">Google</a> than from
+<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
+or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
+
+For comparison, here is the same paragraph written using
+Markdown's inline link style:
+I get 10 times more traffic from [Google](http://google.com/ "Google")
+than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
+[MSN](http://search.msn.com/ "MSN Search").
+
+The point of reference-style links is not that they're easier to
+write. The point is that with reference-style links, your document
+source is vastly more readable. Compare the above examples: using
+reference-style links, the paragraph itself is only 81 characters
+long; with inline-style links, it's 176 characters; and as raw HTML,
+it's 234 characters. In the raw HTML, there's more markup than there
+is text.
+With Markdown's reference-style links, a source document much more
+closely resembles the final output, as rendered in a browser. By
+allowing you to move the markup-related metadata out of the paragraph,
+you can add links without interrupting the narrative flow of your
+prose.
+Emphasis
+
+Markdown treats asterisks (*
) and underscores (_
) as indicators of
+emphasis. Text wrapped with one *
or _
will be wrapped with an
+HTML <em>
tag; double *
's or _
's will be wrapped with an HTML
+<strong>
tag. E.g., this input:
+*single asterisks*
+
+_single underscores_
+
+**double asterisks**
+
+__double underscores__
+
+will produce:
+<em>single asterisks</em>
+
+<em>single underscores</em>
+
+<strong>double asterisks</strong>
+
+<strong>double underscores</strong>
+
+You can use whichever style you prefer; the lone restriction is that
+the same character must be used to open and close an emphasis span.
+Emphasis can be used in the middle of a word:
+un*fucking*believable
+
+But if you surround an *
or _
with spaces, it'll be treated as a
+literal asterisk or underscore.
+To produce a literal asterisk or underscore at a position where it
+would otherwise be used as an emphasis delimiter, you can backslash
+escape it:
+\*this text is surrounded by literal asterisks\*
+
+Code
+
+To indicate a span of code, wrap it with backtick quotes (`
).
+Unlike a pre-formatted code block, a code span indicates code within a
+normal paragraph. For example:
+Use the `printf()` function.
+
+will produce:
+<p>Use the <code>printf()</code> function.</p>
+
+To include a literal backtick character within a code span, you can use
+multiple backticks as the opening and closing delimiters:
+``There is a literal backtick (`) here.``
+
+which will produce this:
+<p><code>There is a literal backtick (`) here.</code></p>
+
+The backtick delimiters surrounding a code span may include spaces --
+one after the opening, one before the closing. This allows you to place
+literal backtick characters at the beginning or end of a code span:
+A single backtick in a code span: `` ` ``
+
+A backtick-delimited string in a code span: `` `foo` ``
+
+will produce:
+<p>A single backtick in a code span: <code>`</code></p>
+
+<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
+
+With a code span, ampersands and angle brackets are encoded as HTML
+entities automatically, which makes it easy to include example HTML
+tags. Markdown will turn this:
+Please don't use any `<blink>` tags.
+
+into:
+<p>Please don't use any <code><blink></code> tags.</p>
+
+You can write this:
+`—` is the decimal-encoded equivalent of `—`.
+
+to produce:
+<p><code>&#8212;</code> is the decimal-encoded
+equivalent of <code>&mdash;</code>.</p>
+
+Images
+
+Admittedly, it's fairly difficult to devise a "natural" syntax for
+placing images into a plain text document format.
+Markdown uses an image syntax that is intended to resemble the syntax
+for links, allowing for two styles: inline and reference.
+Inline image syntax looks like this:
+![Alt text](/path/to/img.jpg)
+
+![Alt text](/path/to/img.jpg "Optional title")
+
+That is:
+
+- An exclamation mark:
!
;
+- followed by a set of square brackets, containing the
alt
+ attribute text for the image;
+- followed by a set of parentheses, containing the URL or path to
+ the image, and an optional
title
attribute enclosed in double
+ or single quotes.
+
+Reference-style image syntax looks like this:
+![Alt text][id]
+
+Where "id" is the name of a defined image reference. Image references
+are defined using syntax identical to link references:
+[id]: url/to/image "Optional title attribute"
+
+As of this writing, Markdown has no syntax for specifying the
+dimensions of an image; if this is important to you, you can simply
+use regular HTML <img>
tags.
+
+Miscellaneous
+
+Automatic Links
+
+Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:
+<http://example.com/>
+
+Markdown will turn this into:
+<a href="http://example.com/">http://example.com/</a>
+
+Automatic links for email addresses work similarly, except that
+Markdown will also perform a bit of randomized decimal and hex
+entity-encoding to help obscure your address from address-harvesting
+spambots. For example, Markdown will turn this:
+<address@example.com>
+
+into something like this:
+<a href="mailto:addre
+ss@example.co
+m">address@exa
+mple.com</a>
+
+which will render in a browser as a clickable link to "address@example.com".
+(This sort of entity-encoding trick will indeed fool many, if not
+most, address-harvesting bots, but it definitely won't fool all of
+them. It's better than nothing, but an address published in this way
+will probably eventually start receiving spam.)
+Backslash Escapes
+
+Markdown allows you to use backslash escapes to generate literal
+characters which would otherwise have special meaning in Markdown's
+formatting syntax. For example, if you wanted to surround a word with
+literal asterisks (instead of an HTML <em>
tag), you can backslashes
+before the asterisks, like this:
+\*literal asterisks\*
+
+Markdown provides backslash escapes for the following characters:
+\ backslash
+` backtick
+* asterisk
+_ underscore
+{} curly braces
+[] square brackets
+() parentheses
+# hash mark
++ plus sign
+- minus sign (hyphen)
+. dot
+! exclamation mark
+
\ No newline at end of file
diff --git a/markdown/tests/extensions-x-def_list/markdown-syntax.txt b/markdown/tests/extensions-x-def_list/markdown-syntax.txt
new file mode 100644
index 0000000..dabd75c
--- /dev/null
+++ b/markdown/tests/extensions-x-def_list/markdown-syntax.txt
@@ -0,0 +1,888 @@
+Markdown: Syntax
+================
+
+
+
+
+* [Overview](#overview)
+ * [Philosophy](#philosophy)
+ * [Inline HTML](#html)
+ * [Automatic Escaping for Special Characters](#autoescape)
+* [Block Elements](#block)
+ * [Paragraphs and Line Breaks](#p)
+ * [Headers](#header)
+ * [Blockquotes](#blockquote)
+ * [Lists](#list)
+ * [Code Blocks](#precode)
+ * [Horizontal Rules](#hr)
+* [Span Elements](#span)
+ * [Links](#link)
+ * [Emphasis](#em)
+ * [Code](#code)
+ * [Images](#img)
+* [Miscellaneous](#misc)
+ * [Backslash Escapes](#backslash)
+ * [Automatic Links](#autolink)
+
+
+**Note:** This document is itself written using Markdown; you
+can [see the source for it by adding '.text' to the URL][src].
+
+ [src]: /projects/markdown/syntax.text
+
+* * *
+
+Overview
+
+Philosophy
+
+Markdown is intended to be as easy-to-read and easy-to-write as is feasible.
+
+Readability, however, is emphasized above all else. A Markdown-formatted
+document should be publishable as-is, as plain text, without looking
+like it's been marked up with tags or formatting instructions. While
+Markdown's syntax has been influenced by several existing text-to-HTML
+filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4],
+[Grutatext] [5], and [EtText] [6] -- the single biggest source of
+inspiration for Markdown's syntax is the format of plain text email.
+
+ [1]: http://docutils.sourceforge.net/mirror/setext.html
+ [2]: http://www.aaronsw.com/2002/atx/
+ [3]: http://textism.com/tools/textile/
+ [4]: http://docutils.sourceforge.net/rst.html
+ [5]: http://www.triptico.com/software/grutatxt.html
+ [6]: http://ettext.taint.org/doc/
+
+To this end, Markdown's syntax is comprised entirely of punctuation
+characters, which punctuation characters have been carefully chosen so
+as to look like what they mean. E.g., asterisks around a word actually
+look like \*emphasis\*. Markdown lists look like, well, lists. Even
+blockquotes look like quoted passages of text, assuming you've ever
+used email.
+
+
+
+Inline HTML
+
+Markdown's syntax is intended for one purpose: to be used as a
+format for *writing* for the web.
+
+Markdown is not a replacement for HTML, or even close to it. Its
+syntax is very small, corresponding only to a very small subset of
+HTML tags. The idea is *not* to create a syntax that makes it easier
+to insert HTML tags. In my opinion, HTML tags are already easy to
+insert. The idea for Markdown is to make it easy to read, write, and
+edit prose. HTML is a *publishing* format; Markdown is a *writing*
+format. Thus, Markdown's formatting syntax only addresses issues that
+can be conveyed in plain text.
+
+For any markup that is not covered by Markdown's syntax, you simply
+use HTML itself. There's no need to preface it or delimit it to
+indicate that you're switching from Markdown to HTML; you just use
+the tags.
+
+The only restrictions are that block-level HTML elements -- e.g. ``,
+`