\"title", false));
+ Assert.IsNull(LinkDefinition.ParseLinkDefinition("[id]: \'title", false));
+ Assert.IsNull(LinkDefinition.ParseLinkDefinition("[id]: (title", false));
+ Assert.IsNull(LinkDefinition.ParseLinkDefinition("[id]: \"title\" crap", false));
+ Assert.IsNull(LinkDefinition.ParseLinkDefinition("[id]: crap", false));
+ }
+
+ LinkDefinition r;
+ }
+
+}
diff --git a/src/MarkdownDeepTests/MarkdownDeepTests.csproj b/src/MarkdownDeepTests/MarkdownDeepTests.csproj
new file mode 100644
index 0000000..d1602cb
--- /dev/null
+++ b/src/MarkdownDeepTests/MarkdownDeepTests.csproj
@@ -0,0 +1,473 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {CD1F5BFF-0118-4994-86A2-92658A36CE1B}
+ Library
+ Properties
+ MarkdownDeepTests
+ MarkdownDeepTests
+ v4.6.1
+ 512
+
+
+
+
+ 3.5
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+ false
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+ false
+
+
+
+ ..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll
+
+
+ ..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll
+
+
+ ..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll
+
+
+
+ 3.5
+
+
+
+
+ 3.5
+
+
+ 3.5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Always
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {1569ed47-c7c9-4261-b6f4-7445bd0f2c95}
+ MarkdownDeep
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/MoreTestFiles.cs b/src/MarkdownDeepTests/MoreTestFiles.cs
new file mode 100644
index 0000000..959be93
--- /dev/null
+++ b/src/MarkdownDeepTests/MoreTestFiles.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+using MarkdownDeep;
+using System.Reflection;
+
+namespace MarkdownDeepTests
+{
+ [TestFixture]
+ class MoreTestFiles
+ {
+ public static IEnumerable GetTests_mdtest11()
+ {
+ return Utils.GetTests("mdtest11");
+ }
+
+
+ [Test, TestCaseSource("GetTests_mdtest11")]
+ public void Test_mdtest11(string resourceName)
+ {
+ Utils.RunResourceTest(resourceName);
+ }
+
+ public static IEnumerable GetTests_mdtest01()
+ {
+ return Utils.GetTests("mdtest01");
+ }
+
+
+ [Test, TestCaseSource("GetTests_mdtest01")]
+ public void Test_mdtest01(string resourceName)
+ {
+ Utils.RunResourceTest(resourceName);
+ }
+
+
+ /*
+ * Don't run the pandoc test's as they're basically a demonstration of things
+ * that are broken in markdown.
+ *
+ public static IEnumerable GetTests_pandoc()
+ {
+ return Utils.GetTests("pandoc");
+ }
+
+
+ [Test, TestCaseSource("GetTests_pandoc")]
+ public void Test_pandoc(string resourceName)
+ {
+ Utils.RunResourceTest(resourceName);
+ }
+ */
+
+ public static IEnumerable GetTests_phpmarkdown()
+ {
+ return Utils.GetTests("phpmarkdown");
+ }
+
+
+ [Test, TestCaseSource("GetTests_phpmarkdown")]
+ public void Test_phpmarkdown(string resourceName)
+ {
+ Utils.RunResourceTest(resourceName);
+ }
+ }
+}
diff --git a/src/MarkdownDeepTests/Properties/AssemblyInfo.cs b/src/MarkdownDeepTests/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..7f74f1f
--- /dev/null
+++ b/src/MarkdownDeepTests/Properties/AssemblyInfo.cs
@@ -0,0 +1,39 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using NUnit.Framework;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("MarkdownDeepTests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Topten Software")]
+[assembly: AssemblyProduct("MarkdownDeepTests")]
+[assembly: AssemblyCopyright("Copyright © 2010-2011 Topten Software")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("80e81372-b393-44fa-af74-fe39ceae854f")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly: RequiresSTA]
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/SafeModeTests.cs b/src/MarkdownDeepTests/SafeModeTests.cs
new file mode 100644
index 0000000..d7e6de1
--- /dev/null
+++ b/src/MarkdownDeepTests/SafeModeTests.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+using MarkdownDeep;
+using System.Reflection;
+
+namespace MarkdownDeepTests
+{
+ [TestFixture]
+ class SafeModeTests
+ {
+ public static IEnumerable GetTests()
+ {
+ return Utils.GetTests("safemode");
+ }
+
+
+ [Test, TestCaseSource("GetTests")]
+ public void Test(string resourceName)
+ {
+ Utils.RunResourceTest(resourceName);
+ }
+ }
+}
diff --git a/src/MarkdownDeepTests/SpanLevelTests.cs b/src/MarkdownDeepTests/SpanLevelTests.cs
new file mode 100644
index 0000000..7b43569
--- /dev/null
+++ b/src/MarkdownDeepTests/SpanLevelTests.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+using MarkdownDeep;
+using System.Reflection;
+
+namespace MarkdownDeepTests
+{
+ [TestFixture]
+ class SpanLevelTests
+ {
+ public static IEnumerable GetTests()
+ {
+ return Utils.GetTests("spantests");
+ }
+
+
+ [Test, TestCaseSource("GetTests")]
+ public void Test(string resourceName)
+ {
+ Utils.RunResourceTest(resourceName);
+ }
+ }
+}
diff --git a/src/MarkdownDeepTests/SpecialCharacterTests.cs b/src/MarkdownDeepTests/SpecialCharacterTests.cs
new file mode 100644
index 0000000..c5b5ab5
--- /dev/null
+++ b/src/MarkdownDeepTests/SpecialCharacterTests.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+using MarkdownDeep;
+
+namespace MarkdownDeepTests
+{
+ [TestFixture]
+ public class SpecialCharacterTests
+ {
+ [SetUp]
+ public void SetUp()
+ {
+ f = new SpanFormatter(new Markdown());
+ }
+
+ SpanFormatter f;
+
+ [Test]
+ public void SimpleTag()
+ {
+ Assert.AreEqual(f.Format("pre post"), "pre post");
+ }
+
+ [Test]
+ public void TagWithAttributes()
+ {
+ Assert.AreEqual(f.Format("pre link post"), "pre link post");
+ }
+
+ [Test]
+ public void NotATag()
+ {
+ Assert.AreEqual("pre a < b post",
+ f.Format("pre a < b post"));
+ }
+
+ [Test]
+ public void NotATag2()
+ {
+ Assert.AreEqual("pre a<b post",
+ f.Format("pre alink post",
+ f.Format("pre link post"));
+ }
+
+ [Test]
+ public void AmpersandsInParagraphs()
+ {
+ Assert.AreEqual("pre this & that post",
+ f.Format("pre this & that post"));
+ }
+
+ [Test]
+ public void HtmlEntities()
+ {
+ Assert.AreEqual("pre & post",
+ f.Format("pre & post"));
+ Assert.AreEqual("pre { post",
+ f.Format("pre { post"));
+ Assert.AreEqual("pre Ư post",
+ f.Format("pre Ư post"));
+ }
+
+ [Test]
+ public void EscapeChars()
+ {
+ Assert.AreEqual(@"\ ` * _ { } [ ] ( ) # + - . ! >",
+ f.Format(@"\\ \` \* \_ \{ \} \[ \] \( \) \# \+ \- \. \! \>"));
+ }
+
+
+ }
+}
diff --git a/src/MarkdownDeepTests/StringScannerTests.cs b/src/MarkdownDeepTests/StringScannerTests.cs
new file mode 100644
index 0000000..25d18ec
--- /dev/null
+++ b/src/MarkdownDeepTests/StringScannerTests.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+using MarkdownDeep;
+
+namespace MarkdownDeepTests
+{
+ [TestFixture]
+ class StringScannerTests
+ {
+ [Test]
+ public void Tests()
+ {
+ var p = new StringScanner();
+
+ p.Reset("This is a string with something [bracketed]");
+ Assert.IsTrue(p.bof);
+ Assert.IsFalse(p.eof);
+ Assert.IsTrue(p.SkipString("This"));
+ Assert.IsFalse(p.bof);
+ Assert.IsFalse(p.eof);
+ Assert.IsFalse(p.SkipString("huh?"));
+ Assert.IsTrue(p.SkipLinespace());
+ Assert.IsTrue(p.SkipChar('i'));
+ Assert.IsTrue(p.SkipChar('s'));
+ Assert.IsTrue(p.SkipWhitespace());
+ Assert.IsTrue(p.DoesMatchAny(new char[] { 'r', 'a', 't'} ));
+ Assert.IsFalse(p.Find("Not here"));
+ Assert.IsFalse(p.Find("WITH"));
+ Assert.IsFalse(p.FindI("Not here"));
+ Assert.IsTrue(p.FindI("WITH"));
+ Assert.IsTrue(p.Find('['));
+ p.SkipForward(1);
+ p.Mark();
+ Assert.IsTrue(p.Find(']'));
+ Assert.AreEqual("bracketed", p.Extract());
+ Assert.IsTrue(p.SkipChar(']'));
+ Assert.IsTrue(p.eof);
+ }
+ }
+}
diff --git a/src/MarkdownDeepTests/TableSpecTests.cs b/src/MarkdownDeepTests/TableSpecTests.cs
new file mode 100644
index 0000000..fd99c09
--- /dev/null
+++ b/src/MarkdownDeepTests/TableSpecTests.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+using MarkdownDeep;
+
+namespace MarkdownDeepTests
+{
+ [TestFixture]
+ class TableSpecTests
+ {
+ [SetUp]
+ public void SetUp()
+ {
+ }
+
+ TableSpec Parse(string str)
+ {
+ var s = new StringScanner(str);
+ return TableSpec.Parse(s);
+ }
+
+ [Test]
+ public void Simple()
+ {
+ var s = Parse("--|--");
+
+ Assert.IsNotNull(s);
+ Assert.IsFalse(s.LeadingBar);
+ Assert.IsFalse(s.TrailingBar);
+ Assert.AreEqual(2, s.Columns.Count);
+ Assert.AreEqual(ColumnAlignment.NA, s.Columns[0]);
+ Assert.AreEqual(ColumnAlignment.NA, s.Columns[1]);
+ }
+
+ [Test]
+ public void Alignment()
+ {
+ var s = Parse("--|:--|--:|:--:");
+
+ Assert.IsNotNull(s);
+ Assert.IsFalse(s.LeadingBar);
+ Assert.IsFalse(s.TrailingBar);
+ Assert.AreEqual(4, s.Columns.Count);
+ Assert.AreEqual(ColumnAlignment.NA, s.Columns[0]);
+ Assert.AreEqual(ColumnAlignment.Left, s.Columns[1]);
+ Assert.AreEqual(ColumnAlignment.Right, s.Columns[2]);
+ Assert.AreEqual(ColumnAlignment.Center, s.Columns[3]);
+ }
+
+ [Test]
+ public void LeadingTrailingBars()
+ {
+ var s = Parse("|--|:--|--:|:--:|");
+
+ Assert.IsNotNull(s);
+ Assert.IsTrue(s.LeadingBar);
+ Assert.IsTrue(s.TrailingBar);
+ Assert.AreEqual(4, s.Columns.Count);
+ Assert.AreEqual(ColumnAlignment.NA, s.Columns[0]);
+ Assert.AreEqual(ColumnAlignment.Left, s.Columns[1]);
+ Assert.AreEqual(ColumnAlignment.Right, s.Columns[2]);
+ Assert.AreEqual(ColumnAlignment.Center, s.Columns[3]);
+ }
+
+
+ [Test]
+ public void Whitespace()
+ {
+ var s = Parse(" | -- | :-- | --: | :--: | ");
+
+ Assert.IsNotNull(s);
+ Assert.IsTrue(s.LeadingBar);
+ Assert.IsTrue(s.TrailingBar);
+ Assert.AreEqual(4, s.Columns.Count);
+ Assert.AreEqual(ColumnAlignment.NA, s.Columns[0]);
+ Assert.AreEqual(ColumnAlignment.Left, s.Columns[1]);
+ Assert.AreEqual(ColumnAlignment.Right, s.Columns[2]);
+ Assert.AreEqual(ColumnAlignment.Center, s.Columns[3]);
+ }
+
+
+ }
+}
diff --git a/src/MarkdownDeepTests/Utils.cs b/src/MarkdownDeepTests/Utils.cs
new file mode 100644
index 0000000..1f365c4
--- /dev/null
+++ b/src/MarkdownDeepTests/Utils.cs
@@ -0,0 +1,145 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Reflection;
+using NUnit.Framework;
+using System.Windows.Forms;
+
+namespace MarkdownDeepTests
+{
+ public static class Utils
+ {
+ public static IEnumerable GetTests(string foldername)
+ {
+ var names = Assembly.GetExecutingAssembly().GetManifestResourceNames();
+
+ return from name in Assembly.GetExecutingAssembly().GetManifestResourceNames()
+ where name.StartsWith("MarkdownDeepTests.testfiles." + foldername + ".") && (name.EndsWith(".txt") || name.EndsWith(".text"))
+ select new TestCaseData(name);
+ }
+
+ public static string LoadTextResource(string name)
+ {
+ // get a reference to the current assembly
+ var a = System.Reflection.Assembly.GetExecutingAssembly();
+ System.IO.StreamReader r = new System.IO.StreamReader(a.GetManifestResourceStream(name));
+ string str = r.ReadToEnd();
+ r.Close();
+
+ return str;
+ }
+
+
+ public static string strip_redundant_whitespace(string str)
+ {
+ StringBuilder sb = new StringBuilder();
+
+ str = str.Replace("\r\n", "\n");
+
+ int i = 0;
+ while (i < str.Length)
+ {
+ char ch = str[i];
+ switch (ch)
+ {
+ case ' ':
+ case '\t':
+ case '\r':
+ case '\n':
+ // Store start of white space
+ i++;
+
+ // Find end of whitespace
+ while (i < str.Length)
+ {
+ ch = str[i];
+ if (ch != ' ' && ch != '\t' && ch != '\r' && ch != '\n')
+ break;
+
+ i++;
+ }
+
+
+ // Replace with a single space
+ if (i < str.Length && str[i] != '<')
+ sb.Append(' ');
+
+ break;
+
+ case '>':
+ sb.Append("> ");
+ i++;
+ while (i < str.Length)
+ {
+ ch = str[i];
+ if (ch != ' ' && ch != '\t' && ch != '\r' && ch != '\n')
+ break;
+
+ i++;
+ }
+ break;
+
+ case '<':
+ if (i+5")
+ {
+ sb.Append(" ");
+
+ // Special handling for pre blocks
+
+ // Find end
+ int end = str.IndexOf("", i);
+ if (end < 0)
+ end=str.Length;
+
+ // Append the pre block
+ sb.Append(str, i, end - i);
+ sb.Append(" ");
+
+ // Jump to end
+ i = end;
+ }
+ else
+ {
+ sb.Append(" <");
+ i++;
+ }
+ break;
+
+ default:
+ sb.Append(ch);
+ i++;
+ break;
+ }
+ }
+
+ return sb.ToString().Trim();
+ }
+
+ public static void RunResourceTest(string resourceName)
+ {
+ string input = Utils.LoadTextResource(resourceName);
+ string expected = Utils.LoadTextResource(System.IO.Path.ChangeExtension(resourceName, "html"));
+
+ var md = new MarkdownDeep.Markdown();
+ md.SafeMode = resourceName.IndexOf("(SafeMode)") >= 0;
+ md.ExtraMode = resourceName.IndexOf("(ExtraMode)") >= 0;
+ md.GitHubCodeBlocks = resourceName.IndexOf("(GitHubMode)") >= 0;
+ md.MarkdownInHtml = resourceName.IndexOf("(MarkdownInHtml)") >= 0;
+ md.AutoHeadingIDs = resourceName.IndexOf("(AutoHeadingIDs)") >= 0;
+
+ string actual = md.Transform(input);
+ string actual_clean = Utils.strip_redundant_whitespace(actual);
+ string expected_clean = Utils.strip_redundant_whitespace(expected);
+
+ string sep = new string('-', 30) + "\n";
+
+ Console.WriteLine("Input:\n" + sep + input);
+ Console.WriteLine("Actual:\n" + sep + actual);
+ Console.WriteLine("Expected:\n" + sep + expected);
+
+ Assert.AreEqual(expected_clean, actual_clean);
+ }
+ }
+}
+
diff --git a/src/MarkdownDeepTests/XssAttackTests.cs b/src/MarkdownDeepTests/XssAttackTests.cs
new file mode 100644
index 0000000..5cc86bd
--- /dev/null
+++ b/src/MarkdownDeepTests/XssAttackTests.cs
@@ -0,0 +1,136 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using MarkdownDeep;
+using NUnit.Framework;
+using System.Reflection;
+
+namespace MarkdownDeepTests
+{
+ [TestFixture]
+ public class XssAttackTests
+ {
+ public bool IsTagReallySafe(HtmlTag tag)
+ {
+ switch (tag.name)
+ {
+ case "B":
+ case "UL":
+ case "LI":
+ case "I":
+ return tag.attributes.Count == 0;
+
+ case "A":
+ case "a":
+ return tag.closing && tag.attributes.Count == 0;
+ }
+
+ return false;
+ }
+
+
+ public static IEnumerable GetTestsFromFile(string filename)
+ {
+ var tests = Utils.LoadTextResource("MarkdownDeepTests.testfiles.xsstests." + filename);
+
+ // Split into lines
+ string[] lines = tests.Replace("\r\n", "\n").Split('\n');
+
+ // Join bac
+ var strings = new List();
+ string str = null;
+ foreach (var l in lines)
+ {
+ // Ignore
+ if (l.StartsWith("////"))
+ continue;
+
+ // Terminator?
+ if (l == "====== UNTESTED ======")
+ {
+ str = null;
+ break;
+ }
+
+ // Blank line?
+ if (String.IsNullOrEmpty(l.Trim()))
+ {
+ if (str != null)
+ strings.Add(str);
+ str = null;
+
+ continue;
+ }
+
+ if (str == null)
+ str = l;
+ else
+ str = str + "\n" + l;
+ }
+
+ if (str != null)
+ strings.Add(str);
+
+
+ return from s in strings select new TestCaseData(s);
+ }
+
+ public static IEnumerable GetAttacks()
+ {
+ return GetTestsFromFile("xss_attacks.txt");
+ }
+
+
+ [Test, TestCaseSource("GetAttacks")]
+ public void TestAttacksAreBlocked(string input)
+ {
+ StringScanner p = new StringScanner(input);
+
+ while (!p.eof)
+ {
+ HtmlTag tag=HtmlTag.Parse(p);
+ if (tag!=null)
+ {
+ if (tag.IsSafe())
+ {
+ // There's a few tags that really are safe in the test data
+ Assert.IsTrue(IsTagReallySafe(tag));
+ }
+ }
+ else
+ {
+ // Next character
+ p.SkipForward(1);
+ }
+ }
+ }
+
+ public static IEnumerable GetAllowed()
+ {
+ return GetTestsFromFile("non_attacks.txt");
+ }
+
+
+ [Test, TestCaseSource("GetAllowed")]
+ public void TestNonAttacksAreAllowed(string input)
+ {
+ StringScanner p = new StringScanner(input);
+
+ while (!p.eof)
+ {
+ HtmlTag tag = HtmlTag.Parse(p);
+ if (tag != null)
+ {
+ Assert.IsTrue(tag.IsSafe());
+ }
+ else
+ {
+ // Next character
+ p.SkipForward(1);
+ }
+ }
+ }
+
+ }
+}
diff --git a/src/MarkdownDeepTests/app.config b/src/MarkdownDeepTests/app.config
new file mode 100644
index 0000000..4c17769
--- /dev/null
+++ b/src/MarkdownDeepTests/app.config
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/packages.config b/src/MarkdownDeepTests/packages.config
new file mode 100644
index 0000000..0c82178
--- /dev/null
+++ b/src/MarkdownDeepTests/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/AtxHeadings.html b/src/MarkdownDeepTests/testfiles/blocktests/AtxHeadings.html
new file mode 100644
index 0000000..f50fa67
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/AtxHeadings.html
@@ -0,0 +1,38 @@
+heading 1
+
+para
+
+heading 1
+
+para
+
+heading 2
+
+para
+
+heading 2
+
+para
+
+heading 6
+
+para
+
+heading 6
+
+para
+
+heading 6
+
+para
+
+heading 6
+
+para
+
+heading 2
+
+
+
+para
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/AtxHeadings.txt b/src/MarkdownDeepTests/testfiles/blocktests/AtxHeadings.txt
new file mode 100644
index 0000000..1c4ec81
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/AtxHeadings.txt
@@ -0,0 +1,39 @@
+# heading 1
+
+para
+
+# heading 1 #
+
+para
+
+## heading 2
+
+para
+
+## heading 2 ##
+
+para
+
+###### heading 6
+
+para
+
+###### heading 6 ######
+
+para
+
+############ heading 6
+
+para
+
+############ heading 6 ####################################
+
+para
+
+
+##heading 2##
+
+-----
+
+para
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/CodeBlocks.html b/src/MarkdownDeepTests/testfiles/blocktests/CodeBlocks.html
new file mode 100644
index 0000000..7daa208
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/CodeBlocks.html
@@ -0,0 +1,12 @@
+before
+for (int i=0; i<10; i++)
+{
+ print("%i\n", i);
+}
+
+sep
+<div>
+ <p>Copyright © 2010
+</div>
+
+after
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/CodeBlocks.txt b/src/MarkdownDeepTests/testfiles/blocktests/CodeBlocks.txt
new file mode 100644
index 0000000..6e41ae2
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/CodeBlocks.txt
@@ -0,0 +1,14 @@
+before
+
+ for (int i=0; i<10; i++)
+ {
+ print("%i\n", i);
+ }
+
+sep
+
+
+
+after
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/ComplexListItems.html b/src/MarkdownDeepTests/testfiles/blocktests/ComplexListItems.html
new file mode 100644
index 0000000..125d941
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/ComplexListItems.html
@@ -0,0 +1,27 @@
+before
+
+after
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/ComplexListItems.txt b/src/MarkdownDeepTests/testfiles/blocktests/ComplexListItems.txt
new file mode 100644
index 0000000..7a2a643
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/ComplexListItems.txt
@@ -0,0 +1,25 @@
+before
+
+* This is a list item
+
+ it contains some code
+
+ for (int i=0; i<10; i++)
+ {
+ printf("Hello World\n");
+ }
+
+ and a block quote:
+
+ > "I have a dream"
+
+ and an embedded list
+
+ * Apples
+ * Pears
+ * Bananas
+
+ and a hardwrapped
+and left aligned paragraph
+
+after
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedListItems.html b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedListItems.html
new file mode 100644
index 0000000..3993866
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedListItems.html
@@ -0,0 +1,19 @@
+
+- Apples
+wrapped
+- Pears
+wrapped
+- Bananas
+wrapped
+
+
+sep
+
+
+- Apples
+ wrapped
+- Pears
+ wrapped
+- Bananas
+ wrapped
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedListItems.txt b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedListItems.txt
new file mode 100644
index 0000000..37287ee
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedListItems.txt
@@ -0,0 +1,15 @@
+1. Apples
+wrapped
+2. Pears
+wrapped
+3. Bananas
+wrapped
+
+sep
+
+1. Apples
+ wrapped
+2. Pears
+ wrapped
+3. Bananas
+ wrapped
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraph.html b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraph.html
new file mode 100644
index 0000000..310e108
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraph.html
@@ -0,0 +1,4 @@
+p1
+p2
+p3
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraph.txt b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraph.txt
new file mode 100644
index 0000000..46c1ceb
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraph.txt
@@ -0,0 +1,3 @@
+p1
+p2
+p3
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphInListItem.html b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphInListItem.html
new file mode 100644
index 0000000..83fba73
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphInListItem.html
@@ -0,0 +1,10 @@
+before
+
+after
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphInListItem.txt b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphInListItem.txt
new file mode 100644
index 0000000..7f14fda
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphInListItem.txt
@@ -0,0 +1,8 @@
+before
+
+* This is a list item
+
+ with a hardwrapped
+and left aligned paragraph
+
+after
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphWithListLikeLine.html b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphWithListLikeLine.html
new file mode 100644
index 0000000..acf544a
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphWithListLikeLine.html
@@ -0,0 +1,3 @@
+This is a paragraph that was written in
+2010. The year it was written shouldn't
+be treated like a list item
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphWithListLikeLine.txt b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphWithListLikeLine.txt
new file mode 100644
index 0000000..5df70b3
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HardWrappedParagraphWithListLikeLine.txt
@@ -0,0 +1,3 @@
+This is a paragraph that was written in
+2010. The year it was written shouldn't
+be treated like a list item
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HtmlAttributeWithoutValue.html b/src/MarkdownDeepTests/testfiles/blocktests/HtmlAttributeWithoutValue.html
new file mode 100644
index 0000000..3c68617
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HtmlAttributeWithoutValue.html
@@ -0,0 +1 @@
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HtmlAttributeWithoutValue.txt b/src/MarkdownDeepTests/testfiles/blocktests/HtmlAttributeWithoutValue.txt
new file mode 100644
index 0000000..3c68617
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HtmlAttributeWithoutValue.txt
@@ -0,0 +1 @@
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HtmlBlock.html b/src/MarkdownDeepTests/testfiles/blocktests/HtmlBlock.html
new file mode 100644
index 0000000..c144ff8
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HtmlBlock.html
@@ -0,0 +1,18 @@
+before
+
+
+
+sep
+
+
+
+after
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HtmlBlock.txt b/src/MarkdownDeepTests/testfiles/blocktests/HtmlBlock.txt
new file mode 100644
index 0000000..ecca4ab
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HtmlBlock.txt
@@ -0,0 +1,18 @@
+before
+
+
+
+sep
+
+
+
+
+after
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HtmlComments.html b/src/MarkdownDeepTests/testfiles/blocktests/HtmlComments.html
new file mode 100644
index 0000000..fdea5ed
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HtmlComments.html
@@ -0,0 +1,10 @@
+pre
+
+
+
+post
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/HtmlComments.txt b/src/MarkdownDeepTests/testfiles/blocktests/HtmlComments.txt
new file mode 100644
index 0000000..130a8b4
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/HtmlComments.txt
@@ -0,0 +1,9 @@
+pre
+
+
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/InsTypes.html b/src/MarkdownDeepTests/testfiles/blocktests/InsTypes.html
new file mode 100644
index 0000000..94c5a63
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/InsTypes.html
@@ -0,0 +1,8 @@
+
+Some text
+
+
+And here it is inside a paragraph.
+
+And here it is in the middle of a paragraph.
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/InsTypes.txt b/src/MarkdownDeepTests/testfiles/blocktests/InsTypes.txt
new file mode 100644
index 0000000..a616ff9
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/InsTypes.txt
@@ -0,0 +1,7 @@
+
+Some text
+
+
+And here it is inside a paragraph.
+
+And here it is in the middle of a paragraph.
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/MultipleParagraphs.html b/src/MarkdownDeepTests/testfiles/blocktests/MultipleParagraphs.html
new file mode 100644
index 0000000..79327bb
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/MultipleParagraphs.html
@@ -0,0 +1,2 @@
+p1
+p2
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/MultipleParagraphs.txt b/src/MarkdownDeepTests/testfiles/blocktests/MultipleParagraphs.txt
new file mode 100644
index 0000000..bf477c3
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/MultipleParagraphs.txt
@@ -0,0 +1,3 @@
+p1
+
+p2
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/NestedListItems.html b/src/MarkdownDeepTests/testfiles/blocktests/NestedListItems.html
new file mode 100644
index 0000000..7264554
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/NestedListItems.html
@@ -0,0 +1,6 @@
+
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/NestedListItems.txt b/src/MarkdownDeepTests/testfiles/blocktests/NestedListItems.txt
new file mode 100644
index 0000000..19a3c6a
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/NestedListItems.txt
@@ -0,0 +1,4 @@
+* Tab
+ * Tab
+ * Tab
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/ParagraphBreaks.html b/src/MarkdownDeepTests/testfiles/blocktests/ParagraphBreaks.html
new file mode 100644
index 0000000..dc0399c
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/ParagraphBreaks.html
@@ -0,0 +1,10 @@
+this is a paragraph
+with a contained break
+
+this is a heading
+followed by a paragraph
+
+
+- an item
+with a contained break
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/ParagraphBreaks.txt b/src/MarkdownDeepTests/testfiles/blocktests/ParagraphBreaks.txt
new file mode 100644
index 0000000..071b128
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/ParagraphBreaks.txt
@@ -0,0 +1,8 @@
+this is a paragraph
+with a contained break
+
+# this is a heading
+followed by a paragraph
+
+* an item
+with a contained break
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/PartiallyIndentedLists.html b/src/MarkdownDeepTests/testfiles/blocktests/PartiallyIndentedLists.html
new file mode 100644
index 0000000..cd088c9
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/PartiallyIndentedLists.html
@@ -0,0 +1,53 @@
+pre
+
+
+-
+Outer 1
+
+
+- Outer 2
+
+
+between
+
+
+-
+Outer 1
+
+- Inner 1
+- Inner 2
+
+
+- Outer 2
+
+
+between
+
+
+-
+Outer 1
+
+
+- Outer 2
+
+
+between
+
+
+-
+Outer 1
+
+- Inner 1
+- Inner 2
+
+
+- Outer 2
+
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/PartiallyIndentedLists.txt b/src/MarkdownDeepTests/testfiles/blocktests/PartiallyIndentedLists.txt
new file mode 100644
index 0000000..ceaf127
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/PartiallyIndentedLists.txt
@@ -0,0 +1,29 @@
+pre
+
+1. Outer 1
+ - Inner 1
+ - Inner 2
+2. Outer 2
+
+between
+
+* Outer 1
+ 1. Inner 1
+ 2. Inner 2
+* Outer 2
+
+between
+
+* Outer 1
+ * Inner 1
+ * Inner 2
+* Outer 2
+
+between
+
+1. Outer 1
+ 1. Inner 1
+ 2. Inner 2
+2. Outer 2
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocks.html b/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocks.html
new file mode 100644
index 0000000..afaf253
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocks.html
@@ -0,0 +1,34 @@
+before
+
+this is my quote
+this is the second part
+
+after
+
+before
+
+first line
+hard wrapped
+second line
+hard wrapped
+
+after
+
+before
+
+first line
+hard wrapped indented
+second line
+hard wrapped indented
+
+after
+
+before
+
+first line
+hard wrapped
+second line
+hard wrapped
+
+after
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocks.txt b/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocks.txt
new file mode 100644
index 0000000..339de0c
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocks.txt
@@ -0,0 +1,36 @@
+before
+
+> this is my quote
+> this is the second part
+
+after
+
+before
+
+> first line
+hard wrapped
+
+> second line
+hard wrapped
+
+after
+
+before
+
+> first line
+ hard wrapped indented
+
+> second line
+ hard wrapped indented
+
+after
+
+before
+
+>first line
+hard wrapped
+
+>second line
+hard wrapped
+
+after
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocksNested.html b/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocksNested.html
new file mode 100644
index 0000000..2181a9e
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocksNested.html
@@ -0,0 +1,16 @@
+before
+
+
+ this is my quote
+ this is the second part
+
+
+ Nested
+
+
+this is code
+
+
+
+after
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocksNested.txt b/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocksNested.txt
new file mode 100644
index 0000000..1e2ee02
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/QuoteBlocksNested.txt
@@ -0,0 +1,10 @@
+before
+
+> this is my quote
+> this is the second part
+>
+> > Nested
+>
+> this is code
+
+after
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/SetExtHeadings.html b/src/MarkdownDeepTests/testfiles/blocktests/SetExtHeadings.html
new file mode 100644
index 0000000..ea2b6e0
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/SetExtHeadings.html
@@ -0,0 +1,5 @@
+Paragraph
+
+Header
+
+Paragraph
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/SetExtHeadings.txt b/src/MarkdownDeepTests/testfiles/blocktests/SetExtHeadings.txt
new file mode 100644
index 0000000..a316a2c
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/SetExtHeadings.txt
@@ -0,0 +1 @@
+Paragraph
Header
======
Paragraph
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/SimpleOrderedList.html b/src/MarkdownDeepTests/testfiles/blocktests/SimpleOrderedList.html
new file mode 100644
index 0000000..031747b
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/SimpleOrderedList.html
@@ -0,0 +1,6 @@
+
+- Apples
+- Pears
+- Bananas
+
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/SimpleOrderedList.txt b/src/MarkdownDeepTests/testfiles/blocktests/SimpleOrderedList.txt
new file mode 100644
index 0000000..b9e2a4d
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/SimpleOrderedList.txt
@@ -0,0 +1,3 @@
+1. Apples
+2. Pears
+3. Bananas
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/SimpleParagraph.html b/src/MarkdownDeepTests/testfiles/blocktests/SimpleParagraph.html
new file mode 100644
index 0000000..59956ba
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/SimpleParagraph.html
@@ -0,0 +1 @@
+paragraph
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/SimpleParagraph.txt b/src/MarkdownDeepTests/testfiles/blocktests/SimpleParagraph.txt
new file mode 100644
index 0000000..4d5b3a6
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/SimpleParagraph.txt
@@ -0,0 +1 @@
+paragraph
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/SimpleUnorderedList.html b/src/MarkdownDeepTests/testfiles/blocktests/SimpleUnorderedList.html
new file mode 100644
index 0000000..50a50c5
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/SimpleUnorderedList.html
@@ -0,0 +1,5 @@
+
+- Apples
+- Pears
+- Bananas
+
diff --git a/src/MarkdownDeepTests/testfiles/blocktests/SimpleUnorderedList.txt b/src/MarkdownDeepTests/testfiles/blocktests/SimpleUnorderedList.txt
new file mode 100644
index 0000000..860fda0
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/blocktests/SimpleUnorderedList.txt
@@ -0,0 +1,3 @@
+* Apples
+* Pears
+* Bananas
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Abbreviations(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/Abbreviations(ExtraMode).html
new file mode 100644
index 0000000..7033a0d
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Abbreviations(ExtraMode).html
@@ -0,0 +1,7 @@
+WWW at start of doc should match
+A simple case: WWW
+A longer version: WWWW shouldn't match the short one
+This shouldn't match: aWWW nor this: WWWa.
+This should: (WWW) as should this WWW.
+Multiword abbreviations like "Markdown Deep" should also work.
+
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Abbreviations(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/Abbreviations(ExtraMode).txt
new file mode 100644
index 0000000..193cc7b
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Abbreviations(ExtraMode).txt
@@ -0,0 +1,17 @@
+WWW at start of doc should match
+
+A simple case: WWW
+
+A longer version: WWWW shouldn't match the short one
+
+This shouldn't match: aWWW nor this: WWWa.
+
+This should: (WWW) as should this *WWW*.
+
+Multiword abbreviations like "Markdown Deep" should also work.
+
+
+
+*[WWW]: World Wide Web
+*[WWWW]: World Wide Web of Wonder :)
+*[Markdown Deep]: Markdown made Better!
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/BackslashEscapes(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/BackslashEscapes(ExtraMode).html
new file mode 100644
index 0000000..1a11fe9
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/BackslashEscapes(ExtraMode).html
@@ -0,0 +1,22 @@
+pre
+
+Term
+: This is not a definition
+
+sep
+
+|This|is |not|a|table|
+|----|----|---|-|-----|
+|No |it's|not|!|!!!!!|
+
+sep
+
+This is not a heading 1
+=====
+
+Not an autolink <http://www.toptensoftware.com>.
+
+Angle bracket escaping: <p>Paragraph</p>.
+
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/BackslashEscapes(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/BackslashEscapes(ExtraMode).txt
new file mode 100644
index 0000000..352d981
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/BackslashEscapes(ExtraMode).txt
@@ -0,0 +1,22 @@
+pre
+
+Term
+\: This is not a definition
+
+sep
+
+\|This|is |not|a|table|
+\|----|----|---|-|-----|
+\|No |it's|not|!|!!!!!|
+
+sep
+
+This is not a heading 1
+\=====
+
+
+Not an autolink \.
+
+Angle bracket escaping: \Paragraph\
.
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/DefinitionLists(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/DefinitionLists(ExtraMode).html
new file mode 100644
index 0000000..49fc770
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/DefinitionLists(ExtraMode).html
@@ -0,0 +1,57 @@
+simple:
+
+
+- term1
+- definition1
+- term2
+- definition2
+
+
+multiline:
+
+- term1
+- definition1
+continued
+- term2
+- definition2
+continued
+
+
+blanks before definitions:
+
+
+- term1
+definition1
+- term2
+definition2
+
+
+with formatting in terms:
+
+
+- term1
+- definition1
+- term2 link
+- definition2
+
+
+with complex definition:
+
+
+- term1
+-
+
Definition
+
+ - Apples
+ - Pears
+ - Bananas
+
+ Code
+
+
+- term2
+- Simple
+
+
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/DefinitionLists(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/DefinitionLists(ExtraMode).txt
new file mode 100644
index 0000000..556572d
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/DefinitionLists(ExtraMode).txt
@@ -0,0 +1,54 @@
+simple:
+
+term1
+: definition1
+
+term2
+: definition2
+
+multiline:
+
+term1
+: definition1
+continued
+
+term2
+: definition2
+continued
+
+blanks before definitions:
+
+term1
+
+: definition1
+
+term2
+
+: definition2
+
+with formatting in terms:
+
+**term1**
+: definition1
+
+term2 [link](target.com)
+: definition2
+
+with complex definition:
+
+term1
+: Definition
+
+ * Apples
+ * Pears
+ * Bananas
+
+ ~~~
+ Code
+ ~~~
+
+term2
+: Simple
+
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Emphasis(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/Emphasis(ExtraMode).html
new file mode 100644
index 0000000..a22d5d1
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Emphasis(ExtraMode).html
@@ -0,0 +1,12 @@
+pre em post
+pre strong post
+pre in_tern_al post
+pre in_ternal_ post
+pre _in_ternal post
+pre em post
+pre strong post
+pre internal post
+pre internal post
+pre internal post
+bold italic
+bold, italic
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Emphasis(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/Emphasis(ExtraMode).txt
new file mode 100644
index 0000000..4789642
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Emphasis(ExtraMode).txt
@@ -0,0 +1,17 @@
+pre _em_ post
+pre __strong__ post
+pre in_tern_al post
+pre in_ternal_ post
+pre _in_ternal post
+
+
+pre *em* post
+pre **strong** post
+pre in*tern*al post
+pre in*ternal* post
+pre *in*ternal post
+
+__bold__ _italic_
+__bold__, _italic_
+
+
diff --git a/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocks(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocks(ExtraMode).html
new file mode 100644
index 0000000..4482bef
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocks(ExtraMode).html
@@ -0,0 +1,26 @@
+pre
+
+This is a fenced code block
+line 2
+line 3
+
+
+
+This is a fenced code block with blank lines around it
+
+
+
+
+- Apples
+- Pears
+- Bananas
+
+
+This is a code block after a list
+
+
+~~
+This is not a code block
+~~
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocks(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocks(ExtraMode).txt
new file mode 100644
index 0000000..018dc5b
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocks(ExtraMode).txt
@@ -0,0 +1,28 @@
+pre
+
+~~~
+This is a fenced code block
+line 2
+line 3
+~~~
+
+~~~
+
+This is a fenced code block with blank lines around it
+
+~~~
+
+* Apples
+* Pears
+* Bananas
+
+
+~~~
+This is a code block after a list
+~~~
+
+~~
+This is not a code block
+~~
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocksAlt(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocksAlt(ExtraMode).html
new file mode 100644
index 0000000..b97110e
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocksAlt(ExtraMode).html
@@ -0,0 +1,30 @@
+pre
+
+This is a fenced code block
+line 2
+line 3
+
+
+
+
+This is a fenced code block with blank lines around it
+
+
+
+
+- Apples
+- Pears
+- Bananas
+
+
+This is a code block after a list
+
+
+This is inline code
+
+test: {
+
+}
+
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocksAlt(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocksAlt(ExtraMode).txt
new file mode 100644
index 0000000..e09f1d9
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/FencedCodeBlocksAlt(ExtraMode).txt
@@ -0,0 +1,37 @@
+pre
+
+```
+This is a fenced code block
+line 2
+line 3
+
+```
+
+```
+
+This is a fenced code block with blank lines around it
+
+```
+
+* Apples
+* Pears
+* Bananas
+
+
+```
+This is a code block after a list
+```
+
+``
+This is inline code
+``
+
+```
+test: {
+
+}
+```
+
+post
+
+
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Footnotes(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/Footnotes(ExtraMode).html
new file mode 100644
index 0000000..b6b7297
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Footnotes(ExtraMode).html
@@ -0,0 +1,30 @@
+This is a paragraph with a footnote 1
+A second reference to same footnote should be ignored. [^fn1]
+Footnotes are list in the order they're referenced, not defined. 2
+Multiline footnotes with block level formatting are also supported. 3
+
+
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Footnotes(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/Footnotes(ExtraMode).txt
new file mode 100644
index 0000000..cc075d6
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Footnotes(ExtraMode).txt
@@ -0,0 +1,27 @@
+[^fn2]: A second footnote, out of order
+
+This is a paragraph with a footnote [^fn1]
+
+A second reference to same footnote should be ignored. [^fn1]
+
+Footnotes are list in the order they're referenced, not defined. [^fn2]
+
+Multiline footnotes with block level formatting are also supported. [^fn3]
+
+[^fn1]: This is the footnote.
+
+[^fn3]: This is a complex footnote
+
+ It has a list:
+
+ * Apples
+ * Pears
+ * Bananas
+
+ And a quote:
+
+ > That's awesome!
+
+
+
+
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode)(AutoHeadingIDs).html b/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode)(AutoHeadingIDs).html
new file mode 100644
index 0000000..f86c92f
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode)(AutoHeadingIDs).html
@@ -0,0 +1,24 @@
+part 1
+
+part 2
+
+part 3
+
+part 4
+
+
+
+Dogs?--in my house?
+
+
+
+3. Applications
+
+!!!
+
+heading
+
+heading
+
+heading
+
diff --git a/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode)(AutoHeadingIDs).txt b/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode)(AutoHeadingIDs).txt
new file mode 100644
index 0000000..86edbe3
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode)(AutoHeadingIDs).txt
@@ -0,0 +1,24 @@
+# part 1 # {#part1}
+
+# part 2 # {#part2}
+
+part 3 {#part3}
+======
+
+# part 4 {#part4} #
+
+# Header identifiers in HTML #
+
+# Dogs?--in *my* house? #
+
+# [HTML](#html), [S5](#S5), [RTF](#rtf) #
+
+# 3. Applications #
+
+# !!! #
+
+# heading #
+
+# heading #
+
+# heading #
diff --git a/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode).html
new file mode 100644
index 0000000..2b1f198
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode).html
@@ -0,0 +1,13 @@
+part 1
+
+part 2
+
+part 3
+
+part 4
+
+part 5 # {# invalid id}
+
+part 6 {invalid}
+
+part 7 {invalid}
diff --git a/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode).txt
new file mode 100644
index 0000000..aa4c332
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/HeaderIDs(ExtraMode).txt
@@ -0,0 +1,14 @@
+# part 1 # {#part1}
+
+# part 2 # {#part2}
+
+part 3 {#part3}
+======
+
+# part 4 {#part4} #
+
+# part 5 # {# invalid id}
+
+# part 6 {invalid}
+
+# part 7 {invalid} #
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Issue12(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/Issue12(ExtraMode).html
new file mode 100644
index 0000000..324fa94
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Issue12(ExtraMode).html
@@ -0,0 +1,8 @@
+
+- Term
+-
+
Definition
+
+
+
+Heading
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Issue12(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/Issue12(ExtraMode).txt
new file mode 100644
index 0000000..9cfbacc
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Issue12(ExtraMode).txt
@@ -0,0 +1,7 @@
+Term
+
+: Definition
+
+***
+
+# Heading
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Issue26(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/Issue26(ExtraMode).html
new file mode 100644
index 0000000..a2edeaf
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Issue26(ExtraMode).html
@@ -0,0 +1,26 @@
+pre
+
+
+
+
+ | Fruit |
+ Color |
+
+
+
+
+ | App|les |
+ Red |
+
+
+ | Pe|ars |
+ Green |
+
+
+ | Ban|anas |
+ Yellow |
+
+
+
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Issue26(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/Issue26(ExtraMode).txt
new file mode 100644
index 0000000..b404fef
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Issue26(ExtraMode).txt
@@ -0,0 +1,9 @@
+pre
+
+Fruit|Color
+--|--
+App\|les|Red
+Pe\|ars|Green
+Ban\|anas|Yellow
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Issue30(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/Issue30(ExtraMode).html
new file mode 100644
index 0000000..1109061
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Issue30(ExtraMode).html
@@ -0,0 +1 @@
+This is a test, for issue #30
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Issue30(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/Issue30(ExtraMode).txt
new file mode 100644
index 0000000..edb9438
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Issue30(ExtraMode).txt
@@ -0,0 +1 @@
+This is a _test_, for issue #30
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml(ExtraMode).html
new file mode 100644
index 0000000..3623035
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml(ExtraMode).html
@@ -0,0 +1,19 @@
+pre
+
+
+this should not be **bold**
+
+
+
+this should not be **bold**
+
+
+
+
+
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml(ExtraMode).txt
new file mode 100644
index 0000000..17ca92f
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml(ExtraMode).txt
@@ -0,0 +1,19 @@
+pre
+
+
+this should not be **bold**
+
+
+
+this should not be **bold**
+
+
+
+this should be **bold**
+
+
+
+this should be **bold**
+
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode)(MarkdownInHtml).html b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode)(MarkdownInHtml).html
new file mode 100644
index 0000000..5f183ed
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode)(MarkdownInHtml).html
@@ -0,0 +1,16 @@
+pre
+
+
+
this should be bold
+
+
+
this should be bold
+
+
+
+
+
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode)(MarkdownInHtml).txt b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode)(MarkdownInHtml).txt
new file mode 100644
index 0000000..e06043c
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode)(MarkdownInHtml).txt
@@ -0,0 +1,16 @@
+pre
+
+
+this should be **bold**
+
+
+ this should be **bold**
+
+
+ this should be **bold**
+
+
+
+
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode).html
new file mode 100644
index 0000000..5f183ed
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode).html
@@ -0,0 +1,16 @@
+pre
+
+
+
this should be bold
+
+
+
this should be bold
+
+
+
+
+
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode).txt
new file mode 100644
index 0000000..12ac26c
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-DeepNested(ExtraMode).txt
@@ -0,0 +1,16 @@
+pre
+
+
+this should be **bold**
+
+
+ this should be **bold**
+
+
+ this should be **bold**
+
+
+
+
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-Nested(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-Nested(ExtraMode).html
new file mode 100644
index 0000000..cc17604
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-Nested(ExtraMode).html
@@ -0,0 +1,16 @@
+pre
+
+
+this should not be **bold**
+
+
+
this should be bold
+
+
+this should not be **bold**
+
+
+
+
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-Nested(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-Nested(ExtraMode).txt
new file mode 100644
index 0000000..06bb4a2
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/MarkdownInHtml-Nested(ExtraMode).txt
@@ -0,0 +1,17 @@
+pre
+
+
+this should not be **bold**
+
+
+ this should be **bold**
+
+
+ this should not be **bold**
+
+
+
+
+
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/TableAlignment(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/TableAlignment(ExtraMode).html
new file mode 100644
index 0000000..3bb766c
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/TableAlignment(ExtraMode).html
@@ -0,0 +1,22 @@
+pre
+
+
+
+
+ | Unspecified |
+ Left |
+ Center |
+ Right |
+
+
+
+
+ | NA |
+ L |
+ C |
+ R |
+
+
+
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/TableAlignment(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/TableAlignment(ExtraMode).txt
new file mode 100644
index 0000000..8d735af
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/TableAlignment(ExtraMode).txt
@@ -0,0 +1,7 @@
+pre
+
+| Unspecified | Left | Center | Right |
+| ----------- |:---- |:------:| -----:|
+| NA | L | C | R |
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/TableFormatting(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/TableFormatting(ExtraMode).html
new file mode 100644
index 0000000..293dceb
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/TableFormatting(ExtraMode).html
@@ -0,0 +1,24 @@
+pre
+
+
+
+ | Fruit |
+ Color |
+
+
+
+
+ | Apples |
+ Red |
+
+
+ | Pears |
+ Yellow |
+
+
+ | Oranges |
+ Orange |
+
+
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/TableFormatting(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/TableFormatting(ExtraMode).txt
new file mode 100644
index 0000000..edcf8a5
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/TableFormatting(ExtraMode).txt
@@ -0,0 +1,9 @@
+pre
+
+| Fruit | Color |
+| ----- | ----- |
+| Apples | *Red* |
+| Pears | **Yellow** |
+| Oranges | [Orange](orange.com) |
+
+post
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Tables(ExtraMode).html b/src/MarkdownDeepTests/testfiles/extramode/Tables(ExtraMode).html
new file mode 100644
index 0000000..21eeed2
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Tables(ExtraMode).html
@@ -0,0 +1,26 @@
+pre
+
+
+
+
+ | Fruit |
+ Color |
+
+
+
+
+ | Apples |
+ Red |
+
+
+ | Pears |
+ Green |
+
+
+ | Bananas |
+ Yellow |
+
+
+
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/extramode/Tables(ExtraMode).txt b/src/MarkdownDeepTests/testfiles/extramode/Tables(ExtraMode).txt
new file mode 100644
index 0000000..0d2deea
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/extramode/Tables(ExtraMode).txt
@@ -0,0 +1,9 @@
+pre
+
+Fruit|Color
+--|--
+Apples|Red
+Pears|Green
+Bananas|Yellow
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/githubmode/FencedCodeBlocksAlt(GitHubMode).html b/src/MarkdownDeepTests/testfiles/githubmode/FencedCodeBlocksAlt(GitHubMode).html
new file mode 100644
index 0000000..92800bb
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/githubmode/FencedCodeBlocksAlt(GitHubMode).html
@@ -0,0 +1,48 @@
+pre
+
+This is a fenced c# code block
+line 2
+line 3
+
+
+
+This is a fenced c# code block
+line 2
+line 3
+
+
+
+This is a fenced c# code block
+line 2
+line 3
+
+
+
+This is a fenced c# code block
+line 2
+line 3
+
+
+
+This is a fenced nohighlight code block
+line 2
+line 3
+
+
+
+This is a fenced c# code block with blank lines around it
+
+
+
+
+- Apples
+- Pears
+- Bananas
+
+
+This is a c# code block after a list
+
+
+This is inline code
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/githubmode/FencedCodeBlocksAlt(GitHubMode).txt b/src/MarkdownDeepTests/testfiles/githubmode/FencedCodeBlocksAlt(GitHubMode).txt
new file mode 100644
index 0000000..6a171fe
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/githubmode/FencedCodeBlocksAlt(GitHubMode).txt
@@ -0,0 +1,57 @@
+pre
+
+```cs
+This is a fenced c# code block
+line 2
+line 3
+
+```
+
+``` cs
+This is a fenced c# code block
+line 2
+line 3
+
+```
+
+``` cs
+This is a fenced c# code block
+line 2
+line 3
+
+```
+
+``` cs
+This is a fenced c# code block
+line 2
+line 3
+
+```
+
+
+```
+This is a fenced nohighlight code block
+line 2
+line 3
+```
+
+```cs
+
+This is a fenced c# code block with blank lines around it
+
+```
+
+* Apples
+* Pears
+* Bananas
+
+
+```cs
+This is a c# code block after a list
+```
+
+``
+This is inline code
+``
+
+post
diff --git a/src/MarkdownDeepTests/testfiles/mdtest01/code-inside-list.html b/src/MarkdownDeepTests/testfiles/mdtest01/code-inside-list.html
new file mode 100644
index 0000000..6b088dc
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest01/code-inside-list.html
@@ -0,0 +1,18 @@
+
+one
+
+code<t>
+indented 8 spaces<t>
+
+two
+
+code<t>
+ idented-12-spaces<t>
+
+three
+
+code<t>
+
+ indented-12-spaces<t>
+
+
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/mdtest01/code-inside-list.text b/src/MarkdownDeepTests/testfiles/mdtest01/code-inside-list.text
new file mode 100644
index 0000000..a840ffd
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest01/code-inside-list.text
@@ -0,0 +1,15 @@
+1. one
+
+ code
+ indented 8 spaces
+
+2. two
+
+ code
+ idented-12-spaces
+
+3. three
+
+ code
+
+ indented-12-spaces
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-cr.html b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-cr.html
new file mode 100644
index 0000000..13334ee
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-cr.html
@@ -0,0 +1,40 @@
+Header
+
+
+
+Some bold Some italic and a link
+
+A little code sample
+
+</head>
+<title>Web Page Title</title>
+</head>
+
+
+A picture
+
+
+
+A list
+
+
+
+A numbered list
+
+
+- a
+- b
+- c
+
+
+A little quote
+
+
+ It is now time for all good men to come to the aid of their country.
+
+
+A final paragraph.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-cr.text b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-cr.text
new file mode 100644
index 0000000..aaafc25
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-cr.text
@@ -0,0 +1 @@
+##Header##
----------
Some **bold** Some *italic* and [a link][1]
A little code sample
Web Page Title
A picture
![alt text][2]
A list
- apples
- oranges
- eggs
A numbered list
1. a
2. b
3. c
A little quote
> It is now time for all good men to come to the aid of their country.
A final paragraph.
[1]: http://www.google.com
[2]: http://www.google.com/intl/en_ALL/images/logo.gif
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-crlf.html b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-crlf.html
new file mode 100644
index 0000000..13334ee
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-crlf.html
@@ -0,0 +1,40 @@
+Header
+
+
+
+Some bold Some italic and a link
+
+A little code sample
+
+</head>
+<title>Web Page Title</title>
+</head>
+
+
+A picture
+
+
+
+A list
+
+
+
+A numbered list
+
+
+- a
+- b
+- c
+
+
+A little quote
+
+
+ It is now time for all good men to come to the aid of their country.
+
+
+A final paragraph.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-crlf.text b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-crlf.text
new file mode 100644
index 0000000..ba0c568
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-crlf.text
@@ -0,0 +1,36 @@
+##Header##
+
+----------
+
+Some **bold** Some *italic* and [a link][1]
+
+A little code sample
+
+
+ Web Page Title
+
+
+A picture
+
+![alt text][2]
+
+A list
+
+- apples
+- oranges
+- eggs
+
+A numbered list
+
+1. a
+2. b
+3. c
+
+A little quote
+
+> It is now time for all good men to come to the aid of their country.
+
+A final paragraph.
+
+ [1]: http://www.google.com
+ [2]: http://www.google.com/intl/en_ALL/images/logo.gif
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-lf.html b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-lf.html
new file mode 100644
index 0000000..13334ee
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-lf.html
@@ -0,0 +1,40 @@
+Header
+
+
+
+Some bold Some italic and a link
+
+A little code sample
+
+</head>
+<title>Web Page Title</title>
+</head>
+
+
+A picture
+
+
+
+A list
+
+
+
+A numbered list
+
+
+- a
+- b
+- c
+
+
+A little quote
+
+
+ It is now time for all good men to come to the aid of their country.
+
+
+A final paragraph.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-lf.text b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-lf.text
new file mode 100644
index 0000000..ba0c568
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest01/line-endings-lf.text
@@ -0,0 +1,36 @@
+##Header##
+
+----------
+
+Some **bold** Some *italic* and [a link][1]
+
+A little code sample
+
+
+ Web Page Title
+
+
+A picture
+
+![alt text][2]
+
+A list
+
+- apples
+- oranges
+- eggs
+
+A numbered list
+
+1. a
+2. b
+3. c
+
+A little quote
+
+> It is now time for all good men to come to the aid of their country.
+
+A final paragraph.
+
+ [1]: http://www.google.com
+ [2]: http://www.google.com/intl/en_ALL/images/logo.gif
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/mdtest01/markdown-readme.html b/src/MarkdownDeepTests/testfiles/mdtest01/markdown-readme.html
new file mode 100644
index 0000000..f542a6d
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest01/markdown-readme.html
@@ -0,0 +1,317 @@
+Markdown
+
+Version 1.0.1 - Tue 14 Dec 2004
+
+by John Gruber
+http://daringfireball.net/
+
+Introduction
+
+Markdown is a text-to-HTML conversion tool for web writers. Markdown
+allows you to write using an easy-to-read, easy-to-write plain text
+format, then convert it to structurally valid XHTML (or HTML).
+
+Thus, "Markdown" is two things: a plain text markup syntax, and a
+software tool, written in Perl, that converts the plain text markup
+to HTML.
+
+Markdown works both as a Movable Type plug-in and as a standalone Perl
+script -- which means it can also be used as a text filter in BBEdit
+(or any other application that supporst filters written in Perl).
+
+Full documentation of Markdown's syntax and configuration options is
+available on the web: http://daringfireball.net/projects/markdown/.
+(Note: this readme file is formatted in Markdown.)
+
+Installation and Requirements
+
+Markdown requires Perl 5.6.0 or later. Welcome to the 21st Century.
+Markdown also requires the standard Perl library module Digest::MD5.
+
+Movable Type
+
+Markdown works with Movable Type version 2.6 or later (including
+MT 3.0 or later).
+
+
+Copy the "Markdown.pl" file into your Movable Type "plugins"
+directory. The "plugins" directory should be in the same directory
+as "mt.cgi"; if the "plugins" directory doesn't already exist, use
+your FTP program to create it. Your installation should look like
+this:
+
+(mt home)/plugins/Markdown.pl
+
+Once installed, Markdown will appear as an option in Movable Type's
+Text Formatting pop-up menu. This is selectable on a per-post basis.
+Markdown translates your posts to HTML when you publish; the posts
+themselves are stored in your MT database in Markdown format.
+If you also install SmartyPants 1.5 (or later), Markdown will offer
+a second text formatting option: "Markdown with SmartyPants". This
+option is the same as the regular "Markdown" formatter, except that
+automatically uses SmartyPants to create typographically correct
+curly quotes, em-dashes, and ellipses. See the SmartyPants web page
+for more information: http://daringfireball.net/projects/smartypants/
+To make Markdown (or "Markdown with SmartyPants") your default
+text formatting option for new posts, go to Weblog Config ->
+Preferences.
+
+
+Note that by default, Markdown produces XHTML output. To configure
+Markdown to produce HTML 4 output, see "Configuration", below.
+
+Blosxom
+
+Markdown works with Blosxom version 2.x.
+
+
+Rename the "Markdown.pl" plug-in to "Markdown" (case is
+important). Movable Type requires plug-ins to have a ".pl"
+extension; Blosxom forbids it.
+Copy the "Markdown" plug-in file to your Blosxom plug-ins folder.
+If you're not sure where your Blosxom plug-ins folder is, see the
+Blosxom documentation for information.
+That's it. The entries in your weblog will now automatically be
+processed by Markdown.
+If you'd like to apply Markdown formatting only to certain posts,
+rather than all of them, see Jason Clark's instructions for using
+Markdown in conjunction with Blosxom's Meta plugin:
+
+http://jclark.org/weblog/WebDev/Blosxom/Markdown.html
+
+
+BBEdit
+
+Markdown works with BBEdit 6.1 or later on Mac OS X. (It also works
+with BBEdit 5.1 or later and MacPerl 5.6.1 on Mac OS 8.6 or later.)
+
+
+Copy the "Markdown.pl" file to appropriate filters folder in your
+"BBEdit Support" folder. On Mac OS X, this should be:
+
+BBEdit Support/Unix Support/Unix Filters/
+
+
+See the BBEdit documentation for more details on the location of
+these folders.
+
+You can rename "Markdown.pl" to whatever you wish.
+That's it. To use Markdown, select some text in a BBEdit document,
+then choose Markdown from the Filters sub-menu in the "#!" menu, or
+the Filters floating palette
+
+
+Configuration
+
+By default, Markdown produces XHTML output for tags with empty elements.
+E.g.:
+
+<br />
+
+
+Markdown can be configured to produce HTML-style tags; e.g.:
+
+<br>
+
+
+Movable Type
+
+You need to use a special MTMarkdownOptions container tag in each
+Movable Type template where you want HTML 4-style output:
+
+<MTMarkdownOptions output='html4'>
+ ... put your entry content here ...
+</MTMarkdownOptions>
+
+
+The easiest way to use MTMarkdownOptions is probably to put the
+opening tag right after your <body> tag, and the closing tag right
+before </body>.
+
+To suppress Markdown processing in a particular template, i.e. to
+publish the raw Markdown-formatted text without translation into
+(X)HTML, set the output attribute to 'raw':
+
+<MTMarkdownOptions output='raw'>
+ ... put your entry content here ...
+</MTMarkdownOptions>
+
+
+Command-Line
+
+Use the --html4tags command-line switch to produce HTML output from a
+Unix-style command line. E.g.:
+
+% perl Markdown.pl --html4tags foo.text
+
+
+Type perldoc Markdown.pl, or read the POD documentation within the
+Markdown.pl source code for more information.
+
+Bugs
+
+To file bug reports or feature requests please send email to:
+markdown@daringfireball.net.
+
+Version History
+
+1.0.1 (14 Dec 2004):
+
+
+Changed the syntax rules for code blocks and spans. Previously,
+backslash escapes for special Markdown characters were processed
+everywhere other than within inline HTML tags. Now, the contents
+of code blocks and spans are no longer processed for backslash
+escapes. This means that code blocks and spans are now treated
+literally, with no special rules to worry about regarding
+backslashes.
+
+NOTE: This changes the syntax from all previous versions of
+Markdown. Code blocks and spans involving backslash characters
+will now generate different output than before.
+Tweaked the rules for link definitions so that they must occur
+within three spaces of the left margin. Thus if you indent a link
+definition by four spaces or a tab, it will now be a code block.
+
+ [a]: /url/ "Indented 3 spaces, this is a link def"
+
+ [b]: /url/ "Indented 4 spaces, this is a code block"
+
+
+IMPORTANT: This may affect existing Markdown content if it
+contains link definitions indented by 4 or more spaces.
+Added >, +, and - to the list of backslash-escapable
+characters. These should have been done when these characters
+were added as unordered list item markers.
+Trailing spaces and tabs following HTML comments and <hr/> tags
+are now ignored.
+Inline links using < and > URL delimiters weren't working:
+
+like [this](<http://example.com/>)
+
+Added a bit of tolerance for trailing spaces and tabs after
+Markdown hr's.
+Fixed bug where auto-links were being processed within code spans:
+
+like this: `<http://example.com/>`
+
+Sort-of fixed a bug where lines in the middle of hard-wrapped
+paragraphs, which lines look like the start of a list item,
+would accidentally trigger the creation of a list. E.g. a
+paragraph that looked like this:
+
+I recommend upgrading to version
+8. Oops, now this line is treated
+as a sub-list.
+
+
+This is fixed for top-level lists, but it can still happen for
+sub-lists. E.g., the following list item will not be parsed
+properly:
+
++ I recommend upgrading to version
+ 8. Oops, now this line is treated
+ as a sub-list.
+
+
+Given Markdown's list-creation rules, I'm not sure this can
+be fixed.
+Standalone HTML comments are now handled; previously, they'd get
+wrapped in a spurious <p> tag.
+Fix for horizontal rules preceded by 2 or 3 spaces.
+<hr> HTML tags in must occur within three spaces of left
+margin. (With 4 spaces or a tab, they should be code blocks, but
+weren't before this fix.)
+Capitalized "With" in "Markdown With SmartyPants" for
+consistency with the same string label in SmartyPants.pl.
+(This fix is specific to the MT plug-in interface.)
+Auto-linked email address can now optionally contain
+a 'mailto:' protocol. I.e. these are equivalent:
+
+<mailto:user@example.com>
+<user@example.com>
+
+Fixed annoying bug where nested lists would wind up with
+spurious (and invalid) <p> tags.
+You can now write empty links:
+
+[like this]()
+
+
+and they'll be turned into anchor tags with empty href attributes.
+This should have worked before, but didn't.
+***this*** and ___this___ are now turned into
+
+<strong><em>this</em></strong>
+
+
+Instead of
+
+<strong><em>this</strong></em>
+
+
+which isn't valid. (Thanks to Michel Fortin for the fix.)
+Added a new substitution in _EncodeCode(): s/\$/$/g; This
+is only for the benefit of Blosxom users, because Blosxom
+(sometimes?) interpolates Perl scalars in your article bodies.
+Fixed problem for links defined with urls that include parens, e.g.:
+
+[1]: http://sources.wikipedia.org/wiki/Middle_East_Policy_(Chomsky)
+
+
+"Chomsky" was being erroneously treated as the URL's title.
+At some point during 1.0's beta cycle, I changed every sub's
+argument fetching from this idiom:
+
+my $text = shift;
+
+
+to:
+
+my $text = shift || return '';
+
+
+The idea was to keep Markdown from doing any work in a sub
+if the input was empty. This introduced a bug, though:
+if the input to any function was the single-character string
+"0", it would also evaluate as false and return immediately.
+How silly. Now fixed.
+
+
+Donations
+
+Donations to support Markdown's development are happily accepted. See:
+http://daringfireball.net/projects/markdown/ for details.
+
+Copyright and License
+
+Copyright (c) 2003-2004 John Gruber
+http://daringfireball.net/
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+Neither the name "Markdown" nor the names of its contributors may
+be used to endorse or promote products derived from this software
+without specific prior written permission.
+
+
+This software is provided by the copyright holders and contributors "as
+is" and any express or implied warranties, including, but not limited
+to, the implied warranties of merchantability and fitness for a
+particular purpose are disclaimed. In no event shall the copyright owner
+or contributors be liable for any direct, indirect, incidental, special,
+exemplary, or consequential damages (including, but not limited to,
+procurement of substitute goods or services; loss of use, data, or
+profits; or business interruption) however caused and on any theory of
+liability, whether in contract, strict liability, or tort (including
+negligence or otherwise) arising in any way out of the use of this
+software, even if advised of the possibility of such damage.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest01/markdown-readme.text b/src/MarkdownDeepTests/testfiles/mdtest01/markdown-readme.text
new file mode 100644
index 0000000..08dc13b
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest01/markdown-readme.text
@@ -0,0 +1,341 @@
+Markdown
+========
+
+Version 1.0.1 - Tue 14 Dec 2004
+
+by John Gruber
+
+
+
+Introduction
+------------
+
+Markdown is a text-to-HTML conversion tool for web writers. Markdown
+allows you to write using an easy-to-read, easy-to-write plain text
+format, then convert it to structurally valid XHTML (or HTML).
+
+Thus, "Markdown" is two things: a plain text markup syntax, and a
+software tool, written in Perl, that converts the plain text markup
+to HTML.
+
+Markdown works both as a Movable Type plug-in and as a standalone Perl
+script -- which means it can also be used as a text filter in BBEdit
+(or any other application that supporst filters written in Perl).
+
+Full documentation of Markdown's syntax and configuration options is
+available on the web: .
+(Note: this readme file is formatted in Markdown.)
+
+
+
+Installation and Requirements
+-----------------------------
+
+Markdown requires Perl 5.6.0 or later. Welcome to the 21st Century.
+Markdown also requires the standard Perl library module `Digest::MD5`.
+
+
+### Movable Type ###
+
+Markdown works with Movable Type version 2.6 or later (including
+MT 3.0 or later).
+
+1. Copy the "Markdown.pl" file into your Movable Type "plugins"
+ directory. The "plugins" directory should be in the same directory
+ as "mt.cgi"; if the "plugins" directory doesn't already exist, use
+ your FTP program to create it. Your installation should look like
+ this:
+
+ (mt home)/plugins/Markdown.pl
+
+2. Once installed, Markdown will appear as an option in Movable Type's
+ Text Formatting pop-up menu. This is selectable on a per-post basis.
+ Markdown translates your posts to HTML when you publish; the posts
+ themselves are stored in your MT database in Markdown format.
+
+3. If you also install SmartyPants 1.5 (or later), Markdown will offer
+ a second text formatting option: "Markdown with SmartyPants". This
+ option is the same as the regular "Markdown" formatter, except that
+ automatically uses SmartyPants to create typographically correct
+ curly quotes, em-dashes, and ellipses. See the SmartyPants web page
+ for more information:
+
+4. To make Markdown (or "Markdown with SmartyPants") your default
+ text formatting option for new posts, go to Weblog Config ->
+ Preferences.
+
+Note that by default, Markdown produces XHTML output. To configure
+Markdown to produce HTML 4 output, see "Configuration", below.
+
+
+### Blosxom ###
+
+Markdown works with Blosxom version 2.x.
+
+1. Rename the "Markdown.pl" plug-in to "Markdown" (case is
+ important). Movable Type requires plug-ins to have a ".pl"
+ extension; Blosxom forbids it.
+
+2. Copy the "Markdown" plug-in file to your Blosxom plug-ins folder.
+ If you're not sure where your Blosxom plug-ins folder is, see the
+ Blosxom documentation for information.
+
+3. That's it. The entries in your weblog will now automatically be
+ processed by Markdown.
+
+4. If you'd like to apply Markdown formatting only to certain posts,
+ rather than all of them, see Jason Clark's instructions for using
+ Markdown in conjunction with Blosxom's Meta plugin:
+
+
+
+
+### BBEdit ###
+
+Markdown works with BBEdit 6.1 or later on Mac OS X. (It also works
+with BBEdit 5.1 or later and MacPerl 5.6.1 on Mac OS 8.6 or later.)
+
+1. Copy the "Markdown.pl" file to appropriate filters folder in your
+ "BBEdit Support" folder. On Mac OS X, this should be:
+
+ BBEdit Support/Unix Support/Unix Filters/
+
+ See the BBEdit documentation for more details on the location of
+ these folders.
+
+ You can rename "Markdown.pl" to whatever you wish.
+
+2. That's it. To use Markdown, select some text in a BBEdit document,
+ then choose Markdown from the Filters sub-menu in the "#!" menu, or
+ the Filters floating palette
+
+
+
+Configuration
+-------------
+
+By default, Markdown produces XHTML output for tags with empty elements.
+E.g.:
+
+
+
+Markdown can be configured to produce HTML-style tags; e.g.:
+
+
+
+
+### Movable Type ###
+
+You need to use a special `MTMarkdownOptions` container tag in each
+Movable Type template where you want HTML 4-style output:
+
+
+ ... put your entry content here ...
+
+
+The easiest way to use MTMarkdownOptions is probably to put the
+opening tag right after your `` tag, and the closing tag right
+before ``.
+
+To suppress Markdown processing in a particular template, i.e. to
+publish the raw Markdown-formatted text without translation into
+(X)HTML, set the `output` attribute to 'raw':
+
+
+ ... put your entry content here ...
+
+
+
+### Command-Line ###
+
+Use the `--html4tags` command-line switch to produce HTML output from a
+Unix-style command line. E.g.:
+
+ % perl Markdown.pl --html4tags foo.text
+
+Type `perldoc Markdown.pl`, or read the POD documentation within the
+Markdown.pl source code for more information.
+
+
+
+Bugs
+----
+
+To file bug reports or feature requests please send email to:
+markdown@daringfireball.net.
+
+
+
+Version History
+---------------
+
+1.0.1 (14 Dec 2004):
+
++ Changed the syntax rules for code blocks and spans. Previously,
+ backslash escapes for special Markdown characters were processed
+ everywhere other than within inline HTML tags. Now, the contents
+ of code blocks and spans are no longer processed for backslash
+ escapes. This means that code blocks and spans are now treated
+ literally, with no special rules to worry about regarding
+ backslashes.
+
+ **NOTE**: This changes the syntax from all previous versions of
+ Markdown. Code blocks and spans involving backslash characters
+ will now generate different output than before.
+
++ Tweaked the rules for link definitions so that they must occur
+ within three spaces of the left margin. Thus if you indent a link
+ definition by four spaces or a tab, it will now be a code block.
+
+ [a]: /url/ "Indented 3 spaces, this is a link def"
+
+ [b]: /url/ "Indented 4 spaces, this is a code block"
+
+ **IMPORTANT**: This may affect existing Markdown content if it
+ contains link definitions indented by 4 or more spaces.
+
++ Added `>`, `+`, and `-` to the list of backslash-escapable
+ characters. These should have been done when these characters
+ were added as unordered list item markers.
+
++ Trailing spaces and tabs following HTML comments and `
` tags
+ are now ignored.
+
++ Inline links using `<` and `>` URL delimiters weren't working:
+
+ like [this]()
+
++ Added a bit of tolerance for trailing spaces and tabs after
+ Markdown hr's.
+
++ Fixed bug where auto-links were being processed within code spans:
+
+ like this: ``
+
++ Sort-of fixed a bug where lines in the middle of hard-wrapped
+ paragraphs, which lines look like the start of a list item,
+ would accidentally trigger the creation of a list. E.g. a
+ paragraph that looked like this:
+
+ I recommend upgrading to version
+ 8. Oops, now this line is treated
+ as a sub-list.
+
+ This is fixed for top-level lists, but it can still happen for
+ sub-lists. E.g., the following list item will not be parsed
+ properly:
+
+ + I recommend upgrading to version
+ 8. Oops, now this line is treated
+ as a sub-list.
+
+ Given Markdown's list-creation rules, I'm not sure this can
+ be fixed.
+
++ Standalone HTML comments are now handled; previously, they'd get
+ wrapped in a spurious `` tag.
+
++ Fix for horizontal rules preceded by 2 or 3 spaces.
+
++ `
` HTML tags in must occur within three spaces of left
+ margin. (With 4 spaces or a tab, they should be code blocks, but
+ weren't before this fix.)
+
++ Capitalized "With" in "Markdown With SmartyPants" for
+ consistency with the same string label in SmartyPants.pl.
+ (This fix is specific to the MT plug-in interface.)
+
++ Auto-linked email address can now optionally contain
+ a 'mailto:' protocol. I.e. these are equivalent:
+
+
+
+
++ Fixed annoying bug where nested lists would wind up with
+ spurious (and invalid) `` tags.
+
++ You can now write empty links:
+
+ [like this]()
+
+ and they'll be turned into anchor tags with empty href attributes.
+ This should have worked before, but didn't.
+
++ `***this***` and `___this___` are now turned into
+
+ this
+
+ Instead of
+
+ this
+
+ which isn't valid. (Thanks to Michel Fortin for the fix.)
+
++ Added a new substitution in `_EncodeCode()`: s/\$/$/g; This
+ is only for the benefit of Blosxom users, because Blosxom
+ (sometimes?) interpolates Perl scalars in your article bodies.
+
++ Fixed problem for links defined with urls that include parens, e.g.:
+
+ [1]: http://sources.wikipedia.org/wiki/Middle_East_Policy_(Chomsky)
+
+ "Chomsky" was being erroneously treated as the URL's title.
+
++ At some point during 1.0's beta cycle, I changed every sub's
+ argument fetching from this idiom:
+
+ my $text = shift;
+
+ to:
+
+ my $text = shift || return '';
+
+ The idea was to keep Markdown from doing any work in a sub
+ if the input was empty. This introduced a bug, though:
+ if the input to any function was the single-character string
+ "0", it would also evaluate as false and return immediately.
+ How silly. Now fixed.
+
+
+
+Donations
+---------
+
+Donations to support Markdown's development are happily accepted. See:
+ for details.
+
+
+
+Copyright and License
+---------------------
+
+Copyright (c) 2003-2004 John Gruber
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+* Neither the name "Markdown" nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+This software is provided by the copyright holders and contributors "as
+is" and any express or implied warranties, including, but not limited
+to, the implied warranties of merchantability and fitness for a
+particular purpose are disclaimed. In no event shall the copyright owner
+or contributors be liable for any direct, indirect, incidental, special,
+exemplary, or consequential damages (including, but not limited to,
+procurement of substitute goods or services; loss of use, data, or
+profits; or business interruption) however caused and on any theory of
+liability, whether in contract, strict liability, or tort (including
+negligence or otherwise) arising in any way out of the use of this
+software, even if advised of the possibility of such damage.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Amps_and_angle_encoding.html b/src/MarkdownDeepTests/testfiles/mdtest11/Amps_and_angle_encoding.html
new file mode 100644
index 0000000..483f8ff
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Amps_and_angle_encoding.html
@@ -0,0 +1,17 @@
+
AT&T has an ampersand in their name.
+
+AT&T is another way to write it.
+
+This & that.
+
+4 < 5.
+
+6 > 5.
+
+Here's a link with an ampersand in the URL.
+
+Here's a link with an amersand in the link text: AT&T.
+
+Here's an inline link.
+
+Here's an inline link.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Amps_and_angle_encoding.text b/src/MarkdownDeepTests/testfiles/mdtest11/Amps_and_angle_encoding.text
new file mode 100644
index 0000000..0e9527f
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Amps_and_angle_encoding.text
@@ -0,0 +1,21 @@
+AT&T has an ampersand in their name.
+
+AT&T is another way to write it.
+
+This & that.
+
+4 < 5.
+
+6 > 5.
+
+Here's a [link] [1] with an ampersand in the URL.
+
+Here's a link with an amersand in the link text: [AT&T] [2].
+
+Here's an inline [link](/script?foo=1&bar=2).
+
+Here's an inline [link]().
+
+
+[1]: http://example.com/?foo=1&bar=2
+[2]: http://att.com/ "AT&T"
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Auto_links.html b/src/MarkdownDeepTests/testfiles/mdtest11/Auto_links.html
new file mode 100644
index 0000000..f8df985
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Auto_links.html
@@ -0,0 +1,18 @@
+Link: http://example.com/.
+
+With an ampersand: http://example.com/?foo=1&bar=2
+
+
+
+
+ Blockquoted: http://example.com/
+
+
+Auto-links should not occur here: <http://example.com/>
+
+or here: <http://example.com/>
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Auto_links.text b/src/MarkdownDeepTests/testfiles/mdtest11/Auto_links.text
new file mode 100644
index 0000000..abbc488
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Auto_links.text
@@ -0,0 +1,13 @@
+Link: .
+
+With an ampersand:
+
+* In a list?
+*
+* It should.
+
+> Blockquoted:
+
+Auto-links should not occur here: ``
+
+ or here:
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Backslash_escapes.html b/src/MarkdownDeepTests/testfiles/mdtest11/Backslash_escapes.html
new file mode 100644
index 0000000..7241d11
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Backslash_escapes.html
@@ -0,0 +1,118 @@
+These should all get escaped:
+
+Backslash: \
+
+Backtick: `
+
+Asterisk: *
+
+Underscore: _
+
+Left brace: {
+
+Right brace: }
+
+Left bracket: [
+
+Right bracket: ]
+
+Left paren: (
+
+Right paren: )
+
+Greater-than: >
+
+Hash: #
+
+Period: .
+
+Bang: !
+
+Plus: +
+
+Minus: -
+
+These should not, because they occur within a code block:
+
+Backslash: \\
+
+Backtick: \`
+
+Asterisk: \*
+
+Underscore: \_
+
+Left brace: \{
+
+Right brace: \}
+
+Left bracket: \[
+
+Right bracket: \]
+
+Left paren: \(
+
+Right paren: \)
+
+Greater-than: \>
+
+Hash: \#
+
+Period: \.
+
+Bang: \!
+
+Plus: \+
+
+Minus: \-
+
+
+Nor should these, which occur in code spans:
+
+Backslash: \\
+
+Backtick: \`
+
+Asterisk: \*
+
+Underscore: \_
+
+Left brace: \{
+
+Right brace: \}
+
+Left bracket: \[
+
+Right bracket: \]
+
+Left paren: \(
+
+Right paren: \)
+
+Greater-than: \>
+
+Hash: \#
+
+Period: \.
+
+Bang: \!
+
+Plus: \+
+
+Minus: \-
+
+
+These should get escaped, even though they're matching pairs for
+other Markdown constructs:
+
+*asterisks*
+
+_underscores_
+
+`backticks`
+
+This is a code span with a literal backslash-backtick sequence: \`
+
+This is a tag with unescaped backticks bar.
+
+This is a tag with backslashes bar.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Backslash_escapes.text b/src/MarkdownDeepTests/testfiles/mdtest11/Backslash_escapes.text
new file mode 100644
index 0000000..5b014cb
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Backslash_escapes.text
@@ -0,0 +1,120 @@
+These should all get escaped:
+
+Backslash: \\
+
+Backtick: \`
+
+Asterisk: \*
+
+Underscore: \_
+
+Left brace: \{
+
+Right brace: \}
+
+Left bracket: \[
+
+Right bracket: \]
+
+Left paren: \(
+
+Right paren: \)
+
+Greater-than: \>
+
+Hash: \#
+
+Period: \.
+
+Bang: \!
+
+Plus: \+
+
+Minus: \-
+
+
+
+These should not, because they occur within a code block:
+
+ Backslash: \\
+
+ Backtick: \`
+
+ Asterisk: \*
+
+ Underscore: \_
+
+ Left brace: \{
+
+ Right brace: \}
+
+ Left bracket: \[
+
+ Right bracket: \]
+
+ Left paren: \(
+
+ Right paren: \)
+
+ Greater-than: \>
+
+ Hash: \#
+
+ Period: \.
+
+ Bang: \!
+
+ Plus: \+
+
+ Minus: \-
+
+
+Nor should these, which occur in code spans:
+
+Backslash: `\\`
+
+Backtick: `` \` ``
+
+Asterisk: `\*`
+
+Underscore: `\_`
+
+Left brace: `\{`
+
+Right brace: `\}`
+
+Left bracket: `\[`
+
+Right bracket: `\]`
+
+Left paren: `\(`
+
+Right paren: `\)`
+
+Greater-than: `\>`
+
+Hash: `\#`
+
+Period: `\.`
+
+Bang: `\!`
+
+Plus: `\+`
+
+Minus: `\-`
+
+
+These should get escaped, even though they're matching pairs for
+other Markdown constructs:
+
+\*asterisks\*
+
+\_underscores\_
+
+\`backticks\`
+
+This is a code span with a literal backslash-backtick sequence: `` \` ``
+
+This is a tag with unescaped backticks bar.
+
+This is a tag with backslashes bar.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Blockquotes_with_code_blocks.html b/src/MarkdownDeepTests/testfiles/mdtest11/Blockquotes_with_code_blocks.html
new file mode 100644
index 0000000..38ee5f0
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Blockquotes_with_code_blocks.html
@@ -0,0 +1,15 @@
+
+ Example:
+
+sub status {
+ print "working";
+}
+
+
+ Or:
+
+sub status {
+ return "working";
+}
+
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Blockquotes_with_code_blocks.text b/src/MarkdownDeepTests/testfiles/mdtest11/Blockquotes_with_code_blocks.text
new file mode 100644
index 0000000..c31d171
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Blockquotes_with_code_blocks.text
@@ -0,0 +1,11 @@
+> Example:
+>
+> sub status {
+> print "working";
+> }
+>
+> Or:
+>
+> sub status {
+> return "working";
+> }
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Code_Blocks.html b/src/MarkdownDeepTests/testfiles/mdtest11/Code_Blocks.html
new file mode 100644
index 0000000..32703f5
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Code_Blocks.html
@@ -0,0 +1,18 @@
+code block on the first line
+
+
+Regular text.
+
+code block indented by spaces
+
+
+Regular text.
+
+the lines in this block
+all contain trailing spaces
+
+
+Regular Text.
+
+code block on the last line
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Code_Blocks.text b/src/MarkdownDeepTests/testfiles/mdtest11/Code_Blocks.text
new file mode 100644
index 0000000..b54b092
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Code_Blocks.text
@@ -0,0 +1,14 @@
+ code block on the first line
+
+Regular text.
+
+ code block indented by spaces
+
+Regular text.
+
+ the lines in this block
+ all contain trailing spaces
+
+Regular Text.
+
+ code block on the last line
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Code_Spans.html b/src/MarkdownDeepTests/testfiles/mdtest11/Code_Spans.html
new file mode 100644
index 0000000..ef85f95
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Code_Spans.html
@@ -0,0 +1,5 @@
+<test a=" content of attribute ">
+
+Fix for backticks within HTML tag: like this
+
+Here's how you put `backticks` in a code span.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Code_Spans.text b/src/MarkdownDeepTests/testfiles/mdtest11/Code_Spans.text
new file mode 100644
index 0000000..5c229c7
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Code_Spans.text
@@ -0,0 +1,5 @@
+``
+
+Fix for backticks within HTML tag: like this
+
+Here's how you put `` `backticks` `` in a code span.
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Hard_wrapped_paragraphs_with_list_like_lines.html b/src/MarkdownDeepTests/testfiles/mdtest11/Hard_wrapped_paragraphs_with_list_like_lines.html
new file mode 100644
index 0000000..e21ac79
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Hard_wrapped_paragraphs_with_list_like_lines.html
@@ -0,0 +1,8 @@
+In Markdown 1.0.0 and earlier. Version
+8. This line turns into a list item.
+Because a hard-wrapped line in the
+middle of a paragraph looked like a
+list item.
+
+Here's one with a bullet.
+* criminey.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Hard_wrapped_paragraphs_with_list_like_lines.text b/src/MarkdownDeepTests/testfiles/mdtest11/Hard_wrapped_paragraphs_with_list_like_lines.text
new file mode 100644
index 0000000..f8a5b27
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Hard_wrapped_paragraphs_with_list_like_lines.text
@@ -0,0 +1,8 @@
+In Markdown 1.0.0 and earlier. Version
+8. This line turns into a list item.
+Because a hard-wrapped line in the
+middle of a paragraph looked like a
+list item.
+
+Here's one with a bullet.
+* criminey.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Horizontal_rules.html b/src/MarkdownDeepTests/testfiles/mdtest11/Horizontal_rules.html
new file mode 100644
index 0000000..2dc2ab6
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Horizontal_rules.html
@@ -0,0 +1,71 @@
+Dashes:
+
+
+
+
+
+
+
+
+
+---
+
+
+
+
+
+
+
+
+
+
+- - -
+
+
+Asterisks:
+
+
+
+
+
+
+
+
+
+***
+
+
+
+
+
+
+
+
+
+
+* * *
+
+
+Underscores:
+
+
+
+
+
+
+
+
+
+___
+
+
+
+
+
+
+
+
+
+
+_ _ _
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Horizontal_rules.text b/src/MarkdownDeepTests/testfiles/mdtest11/Horizontal_rules.text
new file mode 100644
index 0000000..1594bda
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Horizontal_rules.text
@@ -0,0 +1,67 @@
+Dashes:
+
+---
+
+ ---
+
+ ---
+
+ ---
+
+ ---
+
+- - -
+
+ - - -
+
+ - - -
+
+ - - -
+
+ - - -
+
+
+Asterisks:
+
+***
+
+ ***
+
+ ***
+
+ ***
+
+ ***
+
+* * *
+
+ * * *
+
+ * * *
+
+ * * *
+
+ * * *
+
+
+Underscores:
+
+___
+
+ ___
+
+ ___
+
+ ___
+
+ ___
+
+_ _ _
+
+ _ _ _
+
+ _ _ _
+
+ _ _ _
+
+ _ _ _
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Images.html b/src/MarkdownDeepTests/testfiles/mdtest11/Images.html
new file mode 100644
index 0000000..925bc14
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Images.html
@@ -0,0 +1,21 @@
+
+
+
+
+Inline within a paragraph: alt text.
+
+
+
+
+
+
+
+
.
+
+![Empty]()
+
+.jpg)
+
+
+
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Images.text b/src/MarkdownDeepTests/testfiles/mdtest11/Images.text
new file mode 100644
index 0000000..8a51692
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Images.text
@@ -0,0 +1,26 @@
+
+
+
+
+Inline within a paragraph: [alt text](/url/).
+
+
+
+
+
+![alt text]()
+
+.
+
+![Empty]()
+
+.jpg)
+
+
+![alt text][foo]
+
+ [foo]: /url/
+
+![alt text][bar]
+
+ [bar]: /url/ "Title here"
\ No newline at end of file
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Advanced.html b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Advanced.html
new file mode 100644
index 0000000..884f14c
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Advanced.html
@@ -0,0 +1,30 @@
+Simple block on one line:
+
+foo
+
+And nested without indentation:
+
+
+
+And with attributes:
+
+
+
+This was broken in 1.0.2b7:
+
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Advanced.text b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Advanced.text
new file mode 100644
index 0000000..3633f81
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Advanced.text
@@ -0,0 +1,30 @@
+Simple block on one line:
+
+foo
+
+And nested without indentation:
+
+
+
+And with attributes:
+
+
+
+This was broken in 1.0.2b7:
+
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Simple.html b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Simple.html
new file mode 100644
index 0000000..6bf78f8
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Simple.html
@@ -0,0 +1,72 @@
+Here's a simple block:
+
+
+ foo
+
+
+This should be a code block, though:
+
+<div>
+ foo
+</div>
+
+
+As should this:
+
+<div>foo</div>
+
+
+Now, nested:
+
+
+
+This should just be an HTML comment:
+
+
+
+Multiline:
+
+
+
+Code block:
+
+<!-- Comment -->
+
+
+Just plain comment, with trailing spaces on the line:
+
+
+
+Code:
+
+<hr />
+
+
+Hr's:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Simple.text b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Simple.text
new file mode 100644
index 0000000..14aa2dc
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_Simple.text
@@ -0,0 +1,69 @@
+Here's a simple block:
+
+
+ foo
+
+
+This should be a code block, though:
+
+
+ foo
+
+
+As should this:
+
+ foo
+
+Now, nested:
+
+
+
+This should just be an HTML comment:
+
+
+
+Multiline:
+
+
+
+Code block:
+
+
+
+Just plain comment, with trailing spaces on the line:
+
+
+
+Code:
+
+
+
+Hr's:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_comments.html b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_comments.html
new file mode 100644
index 0000000..3f167a1
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_comments.html
@@ -0,0 +1,13 @@
+Paragraph one.
+
+
+
+
+
+Paragraph two.
+
+
+
+The end.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_comments.text b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_comments.text
new file mode 100644
index 0000000..41d830d
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Inline_HTML_comments.text
@@ -0,0 +1,13 @@
+Paragraph one.
+
+
+
+
+
+Paragraph two.
+
+
+
+The end.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Links_inline_style.html b/src/MarkdownDeepTests/testfiles/mdtest11/Links_inline_style.html
new file mode 100644
index 0000000..cd7ce24
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Links_inline_style.html
@@ -0,0 +1,25 @@
+Just a URL.
+
+URL and title.
+
+URL and title.
+
+URL and title.
+
+URL and title.
+
+URL wrapped in angle brackets.
+
+URL w/ angle brackets + title.
+
+Empty.
+
+With parens in the URL
+
+(With outer parens and parens in url)
+
+With parens in the URL
+
+(With outer parens and parens in url)
+
+[concat] something to test bug #8
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Links_inline_style.text b/src/MarkdownDeepTests/testfiles/mdtest11/Links_inline_style.text
new file mode 100644
index 0000000..d945434
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Links_inline_style.text
@@ -0,0 +1,27 @@
+Just a [URL](/url/).
+
+[URL and title](/url/ "title").
+
+[URL and title](/url/ "title preceded by two spaces").
+
+[URL and title](/url/ "title preceded by a tab").
+
+[URL and title](/url/ "title has spaces afterward" ).
+
+[URL wrapped in angle brackets]().
+
+[URL w/ angle brackets + title]( "Here's the title").
+
+[Empty]().
+
+[With parens in the URL](http://en.wikipedia.org/wiki/WIMP_\(computing\))
+
+(With outer parens and [parens in url](/foo\(bar\)))
+
+
+[With parens in the URL](/foo\(bar\) "and a title")
+
+(With outer parens and [parens in url](/foo\(bar\) "and a title"))
+
+[concat] something to test bug #8
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Links_reference_style.html b/src/MarkdownDeepTests/testfiles/mdtest11/Links_reference_style.html
new file mode 100644
index 0000000..8e70c32
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Links_reference_style.html
@@ -0,0 +1,52 @@
+Foo bar.
+
+Foo bar.
+
+Foo bar.
+
+With embedded [brackets].
+
+Indented once.
+
+Indented twice.
+
+Indented thrice.
+
+Indented [four][] times.
+
+[four]: /url
+
+
+
+
+this should work
+
+So should this.
+
+And this.
+
+And this.
+
+And this.
+
+But not [that] [].
+
+Nor [that][].
+
+Nor [that].
+
+[Something in brackets like this should work]
+
+[Same with this.]
+
+In this case, this points to something else.
+
+Backslashing should suppress [this] and [this].
+
+
+
+Here's one where the link
+breaks across lines.
+
+Here's another where the link
+breaks across lines, but with a line-ending space.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Links_reference_style.text b/src/MarkdownDeepTests/testfiles/mdtest11/Links_reference_style.text
new file mode 100644
index 0000000..341ec88
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Links_reference_style.text
@@ -0,0 +1,71 @@
+Foo [bar] [1].
+
+Foo [bar][1].
+
+Foo [bar]
+[1].
+
+[1]: /url/ "Title"
+
+
+With [embedded [brackets]] [b].
+
+
+Indented [once][].
+
+Indented [twice][].
+
+Indented [thrice][].
+
+Indented [four][] times.
+
+ [once]: /url
+
+ [twice]: /url
+
+ [thrice]: /url
+
+ [four]: /url
+
+
+[b]: /url/
+
+* * *
+
+[this] [this] should work
+
+So should [this][this].
+
+And [this] [].
+
+And [this][].
+
+And [this].
+
+But not [that] [].
+
+Nor [that][].
+
+Nor [that].
+
+[Something in brackets like [this][] should work]
+
+[Same with [this].]
+
+In this case, [this](/somethingelse/) points to something else.
+
+Backslashing should suppress \[this] and [this\].
+
+[this]: foo
+
+
+* * *
+
+Here's one where the [link
+breaks] across lines.
+
+Here's another where the [link
+breaks] across lines, but with a line-ending space.
+
+
+[link breaks]: /url/
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Links_shortcut_references.html b/src/MarkdownDeepTests/testfiles/mdtest11/Links_shortcut_references.html
new file mode 100644
index 0000000..bf81e93
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Links_shortcut_references.html
@@ -0,0 +1,9 @@
+This is the simple case.
+
+This one has a line
+break.
+
+This one has a line
+break with a line-ending space.
+
+this and the other
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Links_shortcut_references.text b/src/MarkdownDeepTests/testfiles/mdtest11/Links_shortcut_references.text
new file mode 100644
index 0000000..8c44c98
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Links_shortcut_references.text
@@ -0,0 +1,20 @@
+This is the [simple case].
+
+[simple case]: /simple
+
+
+
+This one has a [line
+break].
+
+This one has a [line
+break] with a line-ending space.
+
+[line break]: /foo
+
+
+[this] [that] and the [other]
+
+[this]: /this
+[that]: /that
+[other]: /other
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Literal_quotes_in_titles.html b/src/MarkdownDeepTests/testfiles/mdtest11/Literal_quotes_in_titles.html
new file mode 100644
index 0000000..611c1ac
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Literal_quotes_in_titles.html
@@ -0,0 +1,3 @@
+Foo bar.
+
+Foo bar.
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Literal_quotes_in_titles.text b/src/MarkdownDeepTests/testfiles/mdtest11/Literal_quotes_in_titles.text
new file mode 100644
index 0000000..29d0e42
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Literal_quotes_in_titles.text
@@ -0,0 +1,7 @@
+Foo [bar][].
+
+Foo [bar](/url/ "Title with "quotes" inside").
+
+
+ [bar]: /url/ "Title with "quotes" inside"
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Markdown_Documentation_Basics.html b/src/MarkdownDeepTests/testfiles/mdtest11/Markdown_Documentation_Basics.html
new file mode 100644
index 0000000..ea3a61c
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Markdown_Documentation_Basics.html
@@ -0,0 +1,314 @@
+Markdown: Basics
+
+
+
+Getting the Gist of Markdown's Formatting Syntax
+
+This page offers a brief overview of what it's like to use Markdown.
+The syntax page provides complete, detailed documentation for
+every feature, but Markdown should be very easy to pick up simply by
+looking at a few examples of it in action. The examples on this page
+are written in a before/after style, showing example syntax and the
+HTML output produced by Markdown.
+
+It's also helpful to simply try Markdown out; the Dingus is a
+web application that allows you type your own Markdown-formatted text
+and translate it to XHTML.
+
+Note: This document is itself written using Markdown; you
+can see the source for it by adding '.text' to the URL.
+
+Paragraphs, Headers, Blockquotes
+
+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 spaces or tabs is considered
+blank.) Normal paragraphs should not be intended with spaces or tabs.
+
+Markdown offers two styles of headers: Setext and atx.
+Setext-style headers for <h1> and <h2> are created by
+"underlining" with equal signs (=) and hyphens (-), respectively.
+To create an atx-style header, you put 1-6 hash marks (#) at the
+beginning of the line -- the number of hashes equals the resulting
+HTML header level.
+
+Blockquotes are indicated using email-style '>' angle brackets.
+
+Markdown:
+
+A First Level Header
+====================
+
+A Second Level Header
+---------------------
+
+Now is the time for all good men to come to
+the aid of their country. This is just a
+regular paragraph.
+
+The quick brown fox jumped over the lazy
+dog's back.
+
+### Header 3
+
+> This is a blockquote.
+>
+> This is the second paragraph in the blockquote.
+>
+> ## This is an H2 in a blockquote
+
+
+Output:
+
+<h1>A First Level Header</h1>
+
+<h2>A Second Level Header</h2>
+
+<p>Now is the time for all good men to come to
+the aid of their country. This is just a
+regular paragraph.</p>
+
+<p>The quick brown fox jumped over the lazy
+dog's back.</p>
+
+<h3>Header 3</h3>
+
+<blockquote>
+ <p>This is a blockquote.</p>
+
+ <p>This is the second paragraph in the blockquote.</p>
+
+ <h2>This is an H2 in a blockquote</h2>
+</blockquote>
+
+
+Phrase Emphasis
+
+Markdown uses asterisks and underscores to indicate spans of emphasis.
+
+Markdown:
+
+Some of these words *are emphasized*.
+Some of these words _are emphasized also_.
+
+Use two asterisks for **strong emphasis**.
+Or, if you prefer, __use two underscores instead__.
+
+
+Output:
+
+<p>Some of these words <em>are emphasized</em>.
+Some of these words <em>are emphasized also</em>.</p>
+
+<p>Use two asterisks for <strong>strong emphasis</strong>.
+Or, if you prefer, <strong>use two underscores instead</strong>.</p>
+
+
+Lists
+
+Unordered (bulleted) lists use asterisks, pluses, and hyphens (*,
++, and -) as list markers. These three markers are
+interchangable; this:
+
+* Candy.
+* Gum.
+* Booze.
+
+
+this:
+
++ Candy.
++ Gum.
++ Booze.
+
+
+and this:
+
+- Candy.
+- Gum.
+- Booze.
+
+
+all produce the same output:
+
+<ul>
+<li>Candy.</li>
+<li>Gum.</li>
+<li>Booze.</li>
+</ul>
+
+
+Ordered (numbered) lists use regular numbers, followed by periods, as
+list markers:
+
+1. Red
+2. Green
+3. Blue
+
+
+Output:
+
+<ol>
+<li>Red</li>
+<li>Green</li>
+<li>Blue</li>
+</ol>
+
+
+If you put blank lines between items, you'll get <p> tags for the
+list item text. You can create multi-paragraph list items by indenting
+the paragraphs by 4 spaces or 1 tab:
+
+* A list item.
+
+ With multiple paragraphs.
+
+* Another item in the list.
+
+
+Output:
+
+<ul>
+<li><p>A list item.</p>
+<p>With multiple paragraphs.</p></li>
+<li><p>Another item in the list.</p></li>
+</ul>
+
+
+Links
+
+Markdown supports two styles for creating links: inline and
+reference. With both styles, you use square brackets to delimit the
+text you want to turn into a link.
+
+Inline-style links use parentheses immediately after the link text.
+For example:
+
+This is an [example link](http://example.com/).
+
+
+Output:
+
+<p>This is an <a href="http://example.com/">
+example link</a>.</p>
+
+
+Optionally, you may include a title attribute in the parentheses:
+
+This is an [example link](http://example.com/ "With a Title").
+
+
+Output:
+
+<p>This is an <a href="http://example.com/" title="With a Title">
+example link</a>.</p>
+
+
+Reference-style links allow you to refer to your links by names, which
+you define elsewhere in your document:
+
+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"
+
+
+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>
+
+
+The title attribute is optional. Link names may contain letters,
+numbers and spaces, but are not case sensitive:
+
+I start my morning with a cup of coffee and
+[The New York Times][NY Times].
+
+[ny times]: http://www.nytimes.com/
+
+
+Output:
+
+<p>I start my morning with a cup of coffee and
+<a href="http://www.nytimes.com/">The New York Times</a>.</p>
+
+
+Images
+
+Image syntax is very much like link syntax.
+
+Inline (titles are optional):
+
+
+
+
+Reference-style:
+
+![alt text][id]
+
+[id]: /path/to/img.jpg "Title"
+
+
+Both of the above examples produce the same output:
+
+<img src="/path/to/img.jpg" alt="alt text" title="Title" />
+
+
+Code
+
+In a regular paragraph, you can create code span by wrapping text in
+backtick quotes. Any ampersands (&) and angle brackets (< or
+>) will automatically be translated into HTML entities. This makes
+it easy to use Markdown to write about HTML example code:
+
+I strongly recommend against using any `<blink>` tags.
+
+I wish SmartyPants used named entities like `—`
+instead of decimal-encoded entites like `—`.
+
+
+Output:
+
+<p>I strongly recommend against using any
+<code><blink></code> tags.</p>
+
+<p>I wish SmartyPants used named entities like
+<code>&mdash;</code> instead of decimal-encoded
+entites like <code>&#8212;</code>.</p>
+
+
+To specify an entire block of pre-formatted code, indent every line of
+the block by 4 spaces or 1 tab. Just like with code spans, &, <,
+and > characters will be escaped automatically.
+
+Markdown:
+
+If you want your page to validate under XHTML 1.0 Strict,
+you've got to put paragraph tags in your blockquotes:
+
+ <blockquote>
+ <p>For example.</p>
+ </blockquote>
+
+
+Output:
+
+<p>If you want your page to validate under XHTML 1.0 Strict,
+you've got to put paragraph tags in your blockquotes:</p>
+
+<pre><code><blockquote>
+ <p>For example.</p>
+</blockquote>
+</code></pre>
+
diff --git a/src/MarkdownDeepTests/testfiles/mdtest11/Markdown_Documentation_Basics.text b/src/MarkdownDeepTests/testfiles/mdtest11/Markdown_Documentation_Basics.text
new file mode 100644
index 0000000..486055c
--- /dev/null
+++ b/src/MarkdownDeepTests/testfiles/mdtest11/Markdown_Documentation_Basics.text
@@ -0,0 +1,306 @@
+Markdown: Basics
+================
+
+
+
+
+Getting the Gist of Markdown's Formatting Syntax
+------------------------------------------------
+
+This page offers a brief overview of what it's like to use Markdown.
+The [syntax page] [s] provides complete, detailed documentation for
+every feature, but Markdown should be very easy to pick up simply by
+looking at a few examples of it in action. The examples on this page
+are written in a before/after style, showing example syntax and the
+HTML output produced by Markdown.
+
+It's also helpful to simply try Markdown out; the [Dingus] [d] is a
+web application that allows you type your own Markdown-formatted text
+and translate it to XHTML.
+
+**Note:** This document is itself written using Markdown; you
+can [see the source for it by adding '.text' to the URL] [src].
+
+ [s]: /projects/markdown/syntax "Markdown Syntax"
+ [d]: /projects/markdown/dingus "Markdown Dingus"
+ [src]: /projects/markdown/basics.text
+
+
+## Paragraphs, Headers, Blockquotes ##
+
+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 spaces or tabs is considered
+blank.) Normal paragraphs should not be intended with spaces or tabs.
+
+Markdown offers two styles of headers: *Setext* and *atx*.
+Setext-style headers for `` and `` are created by
+"underlining" with equal signs (`=`) and hyphens (`-`), respectively.
+To create an atx-style header, you put 1-6 hash marks (`#`) at the
+beginning of the line -- the number of hashes equals the resulting
+HTML header level.
+
+Blockquotes are indicated using email-style '`>`' angle brackets.
+
+Markdown:
+
+ A First Level Header
+ ====================
+
+ A Second Level Header
+ ---------------------
+
+ Now is the time for all good men to come to
+ the aid of their country. This is just a
+ regular paragraph.
+
+ The quick brown fox jumped over the lazy
+ dog's back.
+
+ ### Header 3
+
+ > This is a blockquote.
+ >
+ > This is the second paragraph in the blockquote.
+ >
+ > ## This is an H2 in a blockquote
+
+
+Output:
+
+ A First Level Header
+
+ A Second Level Header
+
+
Now is the time for all good men to come to
+ the aid of their country. This is just a
+ regular paragraph.
+
+ The quick brown fox jumped over the lazy
+ dog's back.
+
+ Header 3
+
+
+ This is a blockquote.
+
+ This is the second paragraph in the blockquote.
+
+ This is an H2 in a blockquote
+
+
+
+
+### Phrase Emphasis ###
+
+Markdown uses asterisks and underscores to indicate spans of emphasis.
+
+Markdown:
+
+ Some of these words *are emphasized*.
+ Some of these words _are emphasized also_.
+
+ Use two asterisks for **strong emphasis**.
+ Or, if you prefer, __use two underscores instead__.
+
+Output:
+
+ Some of these words are emphasized.
+ Some of these words are emphasized also.
+
+ Use two asterisks for strong emphasis.
+ Or, if you prefer, use two underscores instead.
+
+
+
+## Lists ##
+
+Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`,
+`+`, and `-`) as list markers. These three markers are
+interchangable; this:
+
+ * Candy.
+ * Gum.
+ * Booze.
+
+this:
+
+ + Candy.
+ + Gum.
+ + Booze.
+
+and this:
+
+ - Candy.
+ - Gum.
+ - Booze.
+
+all produce the same output:
+
+
+ - Candy.
+ - Gum.
+ - Booze.
+
+
+Ordered (numbered) lists use regular numbers, followed by periods, as
+list markers:
+
+ 1. Red
+ 2. Green
+ 3. Blue
+
+Output:
+
+
+ - Red
+ - Green
+ - Blue
+
+
+If you put blank lines between items, you'll get `` tags for the
+list item text. You can create multi-paragraph list items by indenting
+the paragraphs by 4 spaces or 1 tab:
+
+ * A list item.
+
+ With multiple paragraphs.
+
+ * Another item in the list.
+
+Output:
+
+
+
+
+
+### Links ###
+
+Markdown supports two styles for creating links: *inline* and
+*reference*. With both styles, you use square brackets to delimit the
+text you want to turn into a link.
+
+Inline-style links use parentheses immediately after the link text.
+For example:
+
+ This is an [example link](http://example.com/).
+
+Output:
+
+ This is an
+ example link.
+
+Optionally, you may include a title attribute in the parentheses:
+
+ This is an [example link](http://example.com/ "With a Title").
+
+Output:
+
+ This is an
+ example link.
+
+Reference-style links allow you to refer to your links by names, which
+you define elsewhere in your document:
+
+ 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"
+
+Output:
+
+ I get 10 times more traffic from Google than from Yahoo or MSN.
+
+The title attribute is optional. Link names may contain letters,
+numbers and spaces, but are *not* case sensitive:
+
+ I start my morning with a cup of coffee and
+ [The New York Times][NY Times].
+
+ [ny times]: http://www.nytimes.com/
+
+Output:
+
+ I start my morning with a cup of coffee and
+ The New York Times.
+
+
+### Images ###
+
+Image syntax is very much like link syntax.
+
+Inline (titles are optional):
+
+ 
+
+Reference-style:
+
+ ![alt text][id]
+
+ [id]: /path/to/img.jpg "Title"
+
+Both of the above examples produce the same output:
+
+
+
+
+
+### Code ###
+
+In a regular paragraph, you can create code span by wrapping text in
+backtick quotes. Any ampersands (`&`) and angle brackets (`<` or
+`>`) will automatically be translated into HTML entities. This makes
+it easy to use Markdown to write about HTML example code:
+
+ I strongly recommend against using any `