` tag), you can backslashes
+before the asterisks, like this:
+
+ \*literal asterisks\*
+
+Markdown provides backslash escapes for the following characters:
+
+ \ backslash
+ ` backtick
+ * asterisk
+ _ underscore
+ {} curly braces
+ [] square brackets
+ () parentheses
+ # hash mark
+ + plus sign
+ - minus sign (hyphen)
+ . dot
+ ! exclamation mark
+
diff --git a/test/resources/markdown.mdtest/Markdown Documentation - Syntax.xhtml b/test/resources/markdown.mdtest/Markdown Documentation - Syntax.xhtml
new file mode 100644
index 0000000..5c01306
--- /dev/null
+++ b/test/resources/markdown.mdtest/Markdown Documentation - Syntax.xhtml
@@ -0,0 +1,942 @@
+Markdown: Syntax
+
+
+
+
+
+Note: This document is itself written using Markdown; you
+can see the source for it by adding '.text' to the URL.
+
+
+
+Overview
+
+Philosophy
+
+Markdown is intended to be as easy-to-read and easy-to-write as is feasible.
+
+Readability, however, is emphasized above all else. A Markdown-formatted
+document should be publishable as-is, as plain text, without looking
+like it's been marked up with tags or formatting instructions. While
+Markdown's syntax has been influenced by several existing text-to-HTML
+filters -- including Setext, atx, Textile, reStructuredText,
+Grutatext, and EtText -- the single biggest source of
+inspiration for Markdown's syntax is the format of plain text email.
+
+To this end, Markdown's syntax is comprised entirely of punctuation
+characters, which punctuation characters have been carefully chosen so
+as to look like what they mean. E.g., asterisks around a word actually
+look like *emphasis*. Markdown lists look like, well, lists. Even
+blockquotes look like quoted passages of text, assuming you've ever
+used email.
+
+Inline HTML
+
+Markdown's syntax is intended for one purpose: to be used as a
+format for writing for the web.
+
+Markdown is not a replacement for HTML, or even close to it. Its
+syntax is very small, corresponding only to a very small subset of
+HTML tags. The idea is not to create a syntax that makes it easier
+to insert HTML tags. In my opinion, HTML tags are already easy to
+insert. The idea for Markdown is to make it easy to read, write, and
+edit prose. HTML is a publishing format; Markdown is a writing
+format. Thus, Markdown's formatting syntax only addresses issues that
+can be conveyed in plain text.
+
+For any markup that is not covered by Markdown's syntax, you simply
+use HTML itself. There's no need to preface it or delimit it to
+indicate that you're switching from Markdown to HTML; you just use
+the tags.
+
+The only restrictions are that block-level HTML elements -- e.g. <div>,
+<table>, <pre>, <p>, etc. -- must be separated from surrounding
+content by blank lines, and the start and end tags of the block should
+not be indented with tabs or spaces. Markdown is smart enough not
+to add extra (unwanted) <p> tags around HTML block-level tags.
+
+For example, to add an HTML table to a Markdown article:
+
+This is a regular paragraph.
+
+<table>
+ <tr>
+ <td>Foo</td>
+ </tr>
+</table>
+
+This is another regular paragraph.
+
+
+Note that Markdown formatting syntax is not processed within block-level
+HTML tags. E.g., you can't use Markdown-style *emphasis* inside an
+HTML block.
+
+Span-level HTML tags -- e.g. <span>, <cite>, or <del> -- can be
+used anywhere in a Markdown paragraph, list item, or header. If you
+want, you can even use HTML tags instead of Markdown formatting; e.g. if
+you'd prefer to use HTML <a> or <img> tags instead of Markdown's
+link or image syntax, go right ahead.
+
+Unlike block-level HTML tags, Markdown syntax is processed within
+span-level tags.
+
+Automatic Escaping for Special Characters
+
+In HTML, there are two characters that demand special treatment: <
+and &. Left angle brackets are used to start tags; ampersands are
+used to denote HTML entities. If you want to use them as literal
+characters, you must escape them as entities, e.g. <, and
+&.
+
+Ampersands in particular are bedeviling for web writers. If you want to
+write about 'AT&T', you need to write 'AT&T'. You even need to
+escape ampersands within URLs. Thus, if you want to link to:
+
+http://images.google.com/images?num=30&q=larry+bird
+
+
+you need to encode the URL as:
+
+http://images.google.com/images?num=30&q=larry+bird
+
+
+in your anchor tag href attribute. Needless to say, this is easy to
+forget, and is probably the single most common source of HTML validation
+errors in otherwise well-marked-up web sites.
+
+Markdown allows you to use these characters naturally, taking care of
+all the necessary escaping for you. If you use an ampersand as part of
+an HTML entity, it remains unchanged; otherwise it will be translated
+into &.
+
+So, if you want to include a copyright symbol in your article, you can write:
+
+©
+
+
+and Markdown will leave it alone. But if you write:
+
+AT&T
+
+
+Markdown will translate it to:
+
+AT&T
+
+
+Similarly, because Markdown supports inline HTML, if you use
+angle brackets as delimiters for HTML tags, Markdown will treat them as
+such. But if you write:
+
+4 < 5
+
+
+Markdown will translate it to:
+
+4 < 5
+
+
+However, inside Markdown code spans and blocks, angle brackets and
+ampersands are always encoded automatically. This makes it easy to use
+Markdown to write about HTML code. (As opposed to raw HTML, which is a
+terrible format for writing about HTML syntax, because every single <
+and & in your example code needs to be escaped.)
+
+
+
+Block Elements
+
+Paragraphs and Line Breaks
+
+A paragraph is simply one or more consecutive lines of text, separated
+by one or more blank lines. (A blank line is any line that looks like a
+blank line -- a line containing nothing but spaces or tabs is considered
+blank.) Normal paragraphs should not be intended with spaces or tabs.
+
+The implication of the "one or more consecutive lines of text" rule is
+that Markdown supports "hard-wrapped" text paragraphs. This differs
+significantly from most other text-to-HTML formatters (including Movable
+Type's "Convert Line Breaks" option) which translate every line break
+character in a paragraph into a <br /> tag.
+
+When you do want to insert a <br /> break tag using Markdown, you
+end a line with two or more spaces, then type return.
+
+Yes, this takes a tad more effort to create a <br />, but a simplistic
+"every line break is a <br />" rule wouldn't work for Markdown.
+Markdown's email-style blockquoting and multi-paragraph list items
+work best -- and look better -- when you format them with hard breaks.
+
+
+
+Markdown supports two styles of headers, Setext and atx.
+
+Setext-style headers are "underlined" using equal signs (for first-level
+headers) and dashes (for second-level headers). For example:
+
+This is an H1
+=============
+
+This is an H2
+-------------
+
+
+Any number of underlining ='s or -'s will work.
+
+Atx-style headers use 1-6 hash characters at the start of the line,
+corresponding to header levels 1-6. For example:
+
+# This is an H1
+
+## This is an H2
+
+###### This is an H6
+
+
+Optionally, you may "close" atx-style headers. This is purely
+cosmetic -- you can use this if you think it looks better. The
+closing hashes don't even need to match the number of hashes
+used to open the header. (The number of opening hashes
+determines the header level.) :
+
+# This is an H1 #
+
+## This is an H2 ##
+
+### This is an H3 ######
+
+
+Blockquotes
+
+Markdown uses email-style > characters for blockquoting. If you're
+familiar with quoting passages of text in an email message, then you
+know how to create a blockquote in Markdown. It looks best if you hard
+wrap the text and put a > before every line:
+
+> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+>
+> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
+> id sem consectetuer libero luctus adipiscing.
+
+
+Markdown allows you to be lazy and only put the > before the first
+line of a hard-wrapped paragraph:
+
+> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+
+> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
+id sem consectetuer libero luctus adipiscing.
+
+
+Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
+adding additional levels of >:
+
+> This is the first level of quoting.
+>
+> > This is nested blockquote.
+>
+> Back to the first level.
+
+
+Blockquotes can contain other Markdown elements, including headers, lists,
+and code blocks:
+
+> ## This is a header.
+>
+> 1. This is the first list item.
+> 2. This is the second list item.
+>
+> Here's some example code:
+>
+> return shell_exec("echo $input | $markdown_script");
+
+
+Any decent text editor should make email-style quoting easy. For
+example, with BBEdit, you can make a selection and choose Increase
+Quote Level from the Text menu.
+
+Lists
+
+Markdown supports ordered (numbered) and unordered (bulleted) lists.
+
+Unordered lists use asterisks, pluses, and hyphens -- interchangably
+-- as list markers:
+
+* Red
+* Green
+* Blue
+
+
+is equivalent to:
+
++ Red
++ Green
++ Blue
+
+
+and:
+
+- Red
+- Green
+- Blue
+
+
+Ordered lists use numbers followed by periods:
+
+1. Bird
+2. McHale
+3. Parish
+
+
+It's important to note that the actual numbers you use to mark the
+list have no effect on the HTML output Markdown produces. The HTML
+Markdown produces from the above list is:
+
+<ol>
+<li>Bird</li>
+<li>McHale</li>
+<li>Parish</li>
+</ol>
+
+
+If you instead wrote the list in Markdown like this:
+
+1. Bird
+1. McHale
+1. Parish
+
+
+or even:
+
+3. Bird
+1. McHale
+8. Parish
+
+
+you'd get the exact same HTML output. The point is, if you want to,
+you can use ordinal numbers in your ordered Markdown lists, so that
+the numbers in your source match the numbers in your published HTML.
+But if you want to be lazy, you don't have to.
+
+If you do use lazy list numbering, however, you should still start the
+list with the number 1. At some point in the future, Markdown may support
+starting ordered lists at an arbitrary number.
+
+List markers typically start at the left margin, but may be indented by
+up to three spaces. List markers must be followed by one or more spaces
+or a tab.
+
+To make lists look nice, you can wrap items with hanging indents:
+
+* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
+ viverra nec, fringilla in, laoreet vitae, risus.
+* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
+ Suspendisse id sem consectetuer libero luctus adipiscing.
+
+
+But if you want to be lazy, you don't have to:
+
+* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
+Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
+viverra nec, fringilla in, laoreet vitae, risus.
+* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
+Suspendisse id sem consectetuer libero luctus adipiscing.
+
+
+If list items are separated by blank lines, Markdown will wrap the
+items in <p> tags in the HTML output. For example, this input:
+
+* Bird
+* Magic
+
+
+will turn into:
+
+<ul>
+<li>Bird</li>
+<li>Magic</li>
+</ul>
+
+
+But this:
+
+* Bird
+
+* Magic
+
+
+will turn into:
+
+<ul>
+<li><p>Bird</p></li>
+<li><p>Magic</p></li>
+</ul>
+
+
+List items may consist of multiple paragraphs. Each subsequent
+paragraph in a list item must be intended by either 4 spaces
+or one tab:
+
+1. This is a list item with two paragraphs. Lorem ipsum dolor
+ sit amet, consectetuer adipiscing elit. Aliquam hendrerit
+ mi posuere lectus.
+
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet
+ vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
+ sit amet velit.
+
+2. Suspendisse id sem consectetuer libero luctus adipiscing.
+
+
+It looks nice if you indent every line of the subsequent
+paragraphs, but here again, Markdown will allow you to be
+lazy:
+
+* This is a list item with two paragraphs.
+
+ This is the second paragraph in the list item. You're
+only required to indent the first line. Lorem ipsum dolor
+sit amet, consectetuer adipiscing elit.
+
+* Another item in the same list.
+
+
+To put a blockquote within a list item, the blockquote's >
+delimiters need to be indented:
+
+* A list item with a blockquote:
+
+ > This is a blockquote
+ > inside a list item.
+
+
+To put a code block within a list item, the code block needs
+to be indented twice -- 8 spaces or two tabs:
+
+* A list item with a code block:
+
+ <code goes here>
+
+
+It's worth noting that it's possible to trigger an ordered list by
+accident, by writing something like this:
+
+1986. What a great season.
+
+
+In other words, a number-period-space sequence at the beginning of a
+line. To avoid this, you can backslash-escape the period:
+
+1986\. What a great season.
+
+
+Code Blocks
+
+Pre-formatted code blocks are used for writing about programming or
+markup source code. Rather than forming normal paragraphs, the lines
+of a code block are interpreted literally. Markdown wraps a code block
+in both <pre> and <code> tags.
+
+To produce a code block in Markdown, simply indent every line of the
+block by at least 4 spaces or 1 tab. For example, given this input:
+
+This is a normal paragraph:
+
+ This is a code block.
+
+
+Markdown will generate:
+
+<p>This is a normal paragraph:</p>
+
+<pre><code>This is a code block.
+</code></pre>
+
+
+One level of indentation -- 4 spaces or 1 tab -- is removed from each
+line of the code block. For example, this:
+
+Here is an example of AppleScript:
+
+ tell application "Foo"
+ beep
+ end tell
+
+
+will turn into:
+
+<p>Here is an example of AppleScript:</p>
+
+<pre><code>tell application "Foo"
+ beep
+end tell
+</code></pre>
+
+
+A code block continues until it reaches a line that is not indented
+(or the end of the article).
+
+Within a code block, ampersands (&) and angle brackets (< and >)
+are automatically converted into HTML entities. This makes it very
+easy to include example HTML source code using Markdown -- just paste
+it and indent it, and Markdown will handle the hassle of encoding the
+ampersands and angle brackets. For example, this:
+
+ <div class="footer">
+ © 2004 Foo Corporation
+ </div>
+
+
+will turn into:
+
+<pre><code><div class="footer">
+ &copy; 2004 Foo Corporation
+</div>
+</code></pre>
+
+
+Regular Markdown syntax is not processed within code blocks. E.g.,
+asterisks are just literal asterisks within a code block. This means
+it's also easy to use Markdown to write about Markdown's own syntax.
+
+Horizontal Rules
+
+You can produce a horizontal rule tag (<hr />) by placing three or
+more hyphens, asterisks, or underscores on a line by themselves. If you
+wish, you may use spaces between the hyphens or asterisks. Each of the
+following lines will produce a horizontal rule:
+
+* * *
+
+***
+
+*****
+
+- - -
+
+---------------------------------------
+
+_ _ _
+
+
+
+
+Span Elements
+
+Links
+
+Markdown supports two style of links: inline and reference.
+
+In both styles, the link text is delimited by [square brackets].
+
+To create an inline link, use a set of regular parentheses immediately
+after the link text's closing square bracket. Inside the parentheses,
+put the URL where you want the link to point, along with an optional
+title for the link, surrounded in quotes. For example:
+
+This is [an example](http://example.com/ "Title") inline link.
+
+[This link](http://example.net/) has no title attribute.
+
+
+Will produce:
+
+<p>This is <a href="http://example.com/" title="Title">
+an example</a> inline link.</p>
+
+<p><a href="http://example.net/">This link</a> has no
+title attribute.</p>
+
+
+If you're referring to a local resource on the same server, you can
+use relative paths:
+
+See my [About](/about/) page for details.
+
+
+Reference-style links use a second set of square brackets, inside
+which you place a label of your choosing to identify the link:
+
+This is [an example][id] reference-style link.
+
+
+You can optionally use a space to separate the sets of brackets:
+
+This is [an example] [id] reference-style link.
+
+
+Then, anywhere in the document, you define your link label like this,
+on a line by itself:
+
+[id]: http://example.com/ "Optional Title Here"
+
+
+That is:
+
+
+- Square brackets containing the link identifier (optionally
+indented from the left margin using up to three spaces);
+- followed by a colon;
+- followed by one or more spaces (or tabs);
+- followed by the URL for the link;
+- optionally followed by a title attribute for the link, enclosed
+in double or single quotes.
+
+
+The link URL may, optionally, be surrounded by angle brackets:
+
+[id]: <http://example.com/> "Optional Title Here"
+
+
+You can put the title attribute on the next line and use extra spaces
+or tabs for padding, which tends to look better with longer URLs:
+
+[id]: http://example.com/longish/path/to/resource/here
+ "Optional Title Here"
+
+
+Link definitions are only used for creating links during Markdown
+processing, and are stripped from your document in the HTML output.
+
+Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are not case sensitive. E.g. these two links:
+
+[link text][a]
+[link text][A]
+
+
+are equivalent.
+
+The implicit link name shortcut allows you to omit the name of the
+link, in which case the link text itself is used as the name.
+Just use an empty set of square brackets -- e.g., to link the word
+"Google" to the google.com web site, you could simply write:
+
+[Google][]
+
+
+And then define the link:
+
+[Google]: http://google.com/
+
+
+Because link names may contain spaces, this shortcut even works for
+multiple words in the link text:
+
+Visit [Daring Fireball][] for more information.
+
+
+And then define the link:
+
+[Daring Fireball]: http://daringfireball.net/
+
+
+Link definitions can be placed anywhere in your Markdown document. I
+tend to put them immediately after each paragraph in which they're
+used, but if you want, you can put them all at the end of your
+document, sort of like footnotes.
+
+Here's an example of reference links in action:
+
+I get 10 times more traffic from [Google] [1] than from
+[Yahoo] [2] or [MSN] [3].
+
+ [1]: http://google.com/ "Google"
+ [2]: http://search.yahoo.com/ "Yahoo Search"
+ [3]: http://search.msn.com/ "MSN Search"
+
+
+Using the implicit link name shortcut, you could instead write:
+
+I get 10 times more traffic from [Google][] than from
+[Yahoo][] or [MSN][].
+
+ [google]: http://google.com/ "Google"
+ [yahoo]: http://search.yahoo.com/ "Yahoo Search"
+ [msn]: http://search.msn.com/ "MSN Search"
+
+
+Both of the above examples will produce the following HTML output:
+
+<p>I get 10 times more traffic from <a href="http://google.com/"
+title="Google">Google</a> than from
+<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
+or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
+
+
+For comparison, here is the same paragraph written using
+Markdown's inline link style:
+
+I get 10 times more traffic from [Google](http://google.com/ "Google")
+than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
+[MSN](http://search.msn.com/ "MSN Search").
+
+
+The point of reference-style links is not that they're easier to
+write. The point is that with reference-style links, your document
+source is vastly more readable. Compare the above examples: using
+reference-style links, the paragraph itself is only 81 characters
+long; with inline-style links, it's 176 characters; and as raw HTML,
+it's 234 characters. In the raw HTML, there's more markup than there
+is text.
+
+With Markdown's reference-style links, a source document much more
+closely resembles the final output, as rendered in a browser. By
+allowing you to move the markup-related metadata out of the paragraph,
+you can add links without interrupting the narrative flow of your
+prose.
+
+Emphasis
+
+Markdown treats asterisks (*) and underscores (_) as indicators of
+emphasis. Text wrapped with one * or _ will be wrapped with an
+HTML <em> tag; double *'s or _'s will be wrapped with an HTML
+<strong> tag. E.g., this input:
+
+*single asterisks*
+
+_single underscores_
+
+**double asterisks**
+
+__double underscores__
+
+
+will produce:
+
+<em>single asterisks</em>
+
+<em>single underscores</em>
+
+<strong>double asterisks</strong>
+
+<strong>double underscores</strong>
+
+
+You can use whichever style you prefer; the lone restriction is that
+the same character must be used to open and close an emphasis span.
+
+Emphasis can be used in the middle of a word:
+
+un*fucking*believable
+
+
+But if you surround an * or _ with spaces, it'll be treated as a
+literal asterisk or underscore.
+
+To produce a literal asterisk or underscore at a position where it
+would otherwise be used as an emphasis delimiter, you can backslash
+escape it:
+
+\*this text is surrounded by literal asterisks\*
+
+
+Code
+
+To indicate a span of code, wrap it with backtick quotes (`).
+Unlike a pre-formatted code block, a code span indicates code within a
+normal paragraph. For example:
+
+Use the `printf()` function.
+
+
+will produce:
+
+<p>Use the <code>printf()</code> function.</p>
+
+
+To include a literal backtick character within a code span, you can use
+multiple backticks as the opening and closing delimiters:
+
+``There is a literal backtick (`) here.``
+
+
+which will produce this:
+
+<p><code>There is a literal backtick (`) here.</code></p>
+
+
+The backtick delimiters surrounding a code span may include spaces --
+one after the opening, one before the closing. This allows you to place
+literal backtick characters at the beginning or end of a code span:
+
+A single backtick in a code span: `` ` ``
+
+A backtick-delimited string in a code span: `` `foo` ``
+
+
+will produce:
+
+<p>A single backtick in a code span: <code>`</code></p>
+
+<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
+
+
+With a code span, ampersands and angle brackets are encoded as HTML
+entities automatically, which makes it easy to include example HTML
+tags. Markdown will turn this:
+
+Please don't use any `<blink>` tags.
+
+
+into:
+
+<p>Please don't use any <code><blink></code> tags.</p>
+
+
+You can write this:
+
+`—` is the decimal-encoded equivalent of `—`.
+
+
+to produce:
+
+<p><code>&#8212;</code> is the decimal-encoded
+equivalent of <code>&mdash;</code>.</p>
+
+
+Images
+
+Admittedly, it's fairly difficult to devise a "natural" syntax for
+placing images into a plain text document format.
+
+Markdown uses an image syntax that is intended to resemble the syntax
+for links, allowing for two styles: inline and reference.
+
+Inline image syntax looks like this:
+
+
+
+
+
+
+That is:
+
+
+- An exclamation mark:
!;
+- followed by a set of square brackets, containing the
alt
+attribute text for the image;
+- followed by a set of parentheses, containing the URL or path to
+the image, and an optional
title attribute enclosed in double
+or single quotes.
+
+
+Reference-style image syntax looks like this:
+
+![Alt text][id]
+
+
+Where "id" is the name of a defined image reference. Image references
+are defined using syntax identical to link references:
+
+[id]: url/to/image "Optional title attribute"
+
+
+As of this writing, Markdown has no syntax for specifying the
+dimensions of an image; if this is important to you, you can simply
+use regular HTML <img> tags.
+
+
+
+Miscellaneous
+
+Automatic Links
+
+Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:
+
+<http://example.com/>
+
+
+Markdown will turn this into:
+
+<a href="http://example.com/">http://example.com/</a>
+
+
+Automatic links for email addresses work similarly, except that
+Markdown will also perform a bit of randomized decimal and hex
+entity-encoding to help obscure your address from address-harvesting
+spambots. For example, Markdown will turn this:
+
+<address@example.com>
+
+
+into something like this:
+
+<a href="mailto:addre
+ss@example.co
+m">address@exa
+mple.com</a>
+
+
+which will render in a browser as a clickable link to "address@example.com".
+
+(This sort of entity-encoding trick will indeed fool many, if not
+most, address-harvesting bots, but it definitely won't fool all of
+them. It's better than nothing, but an address published in this way
+will probably eventually start receiving spam.)
+
+Backslash Escapes
+
+Markdown allows you to use backslash escapes to generate literal
+characters which would otherwise have special meaning in Markdown's
+formatting syntax. For example, if you wanted to surround a word with
+literal asterisks (instead of an HTML <em> tag), you can backslashes
+before the asterisks, like this:
+
+\*literal asterisks\*
+
+
+Markdown provides backslash escapes for the following characters:
+
+\ backslash
+` backtick
+* asterisk
+_ underscore
+{} curly braces
+[] square brackets
+() parentheses
+# hash mark
++ plus sign
+- minus sign (hyphen)
+. dot
+! exclamation mark
+
diff --git a/test/resources/markdown.mdtest/Nested blockquotes.text b/test/resources/markdown.mdtest/Nested blockquotes.text
new file mode 100644
index 0000000..ed3c624
--- /dev/null
+++ b/test/resources/markdown.mdtest/Nested blockquotes.text
@@ -0,0 +1,5 @@
+> foo
+>
+> > bar
+>
+> foo
diff --git a/test/resources/markdown.mdtest/Nested blockquotes.xhtml b/test/resources/markdown.mdtest/Nested blockquotes.xhtml
new file mode 100644
index 0000000..d8ec7f8
--- /dev/null
+++ b/test/resources/markdown.mdtest/Nested blockquotes.xhtml
@@ -0,0 +1,9 @@
+
+ foo
+
+
+ bar
+
+
+ foo
+
diff --git a/test/resources/markdown.mdtest/Ordered and unordered lists.text b/test/resources/markdown.mdtest/Ordered and unordered lists.text
new file mode 100644
index 0000000..7f3b497
--- /dev/null
+++ b/test/resources/markdown.mdtest/Ordered and unordered lists.text
@@ -0,0 +1,131 @@
+## Unordered
+
+Asterisks tight:
+
+* asterisk 1
+* asterisk 2
+* asterisk 3
+
+
+Asterisks loose:
+
+* asterisk 1
+
+* asterisk 2
+
+* asterisk 3
+
+* * *
+
+Pluses tight:
+
++ Plus 1
++ Plus 2
++ Plus 3
+
+
+Pluses loose:
+
++ Plus 1
+
++ Plus 2
+
++ Plus 3
+
+* * *
+
+
+Minuses tight:
+
+- Minus 1
+- Minus 2
+- Minus 3
+
+
+Minuses loose:
+
+- Minus 1
+
+- Minus 2
+
+- Minus 3
+
+
+## Ordered
+
+Tight:
+
+1. First
+2. Second
+3. Third
+
+and:
+
+1. One
+2. Two
+3. Three
+
+
+Loose using tabs:
+
+1. First
+
+2. Second
+
+3. Third
+
+and using spaces:
+
+1. One
+
+2. Two
+
+3. Three
+
+Multiple paragraphs:
+
+1. Item 1, graf one.
+
+ Item 2. graf two. The quick brown fox jumped over the lazy dog's
+ back.
+
+2. Item 2.
+
+3. Item 3.
+
+
+
+## Nested
+
+* Tab
+ * Tab
+ * Tab
+
+Here's another:
+
+1. First
+2. Second:
+ * Fee
+ * Fie
+ * Foe
+3. Third
+
+Same thing but with paragraphs:
+
+1. First
+
+2. Second:
+ * Fee
+ * Fie
+ * Foe
+
+3. Third
+
+
+This was an error in Markdown 1.0.1:
+
+* this
+
+ * sub
+
+ that
diff --git a/test/resources/markdown.mdtest/Ordered and unordered lists.xhtml b/test/resources/markdown.mdtest/Ordered and unordered lists.xhtml
new file mode 100644
index 0000000..ba71eab
--- /dev/null
+++ b/test/resources/markdown.mdtest/Ordered and unordered lists.xhtml
@@ -0,0 +1,148 @@
+Unordered
+
+Asterisks tight:
+
+
+- asterisk 1
+- asterisk 2
+- asterisk 3
+
+
+Asterisks loose:
+
+
+asterisk 1
+asterisk 2
+asterisk 3
+
+
+
+
+Pluses tight:
+
+
+- Plus 1
+- Plus 2
+- Plus 3
+
+
+Pluses loose:
+
+
+Plus 1
+Plus 2
+Plus 3
+
+
+
+
+Minuses tight:
+
+
+- Minus 1
+- Minus 2
+- Minus 3
+
+
+Minuses loose:
+
+
+Minus 1
+Minus 2
+Minus 3
+
+
+Ordered
+
+Tight:
+
+
+- First
+- Second
+- Third
+
+
+and:
+
+
+- One
+- Two
+- Three
+
+
+Loose using tabs:
+
+
+First
+Second
+Third
+
+
+and using spaces:
+
+
+One
+Two
+Three
+
+
+Multiple paragraphs:
+
+
+Item 1, graf one.
+
+Item 2. graf two. The quick brown fox jumped over the lazy dog's
+back.
+Item 2.
+Item 3.
+
+
+Nested
+
+
+
+Here's another:
+
+
+- First
+- Second:
+
+- Third
+
+
+Same thing but with paragraphs:
+
+
+First
+Second:
+
+
+Third
+
+
+
+This was an error in Markdown 1.0.1:
+
+
diff --git a/test/resources/markdown.mdtest/Strong and em together.text b/test/resources/markdown.mdtest/Strong and em together.text
new file mode 100644
index 0000000..95ee690
--- /dev/null
+++ b/test/resources/markdown.mdtest/Strong and em together.text
@@ -0,0 +1,7 @@
+***This is strong and em.***
+
+So is ***this*** word.
+
+___This is strong and em.___
+
+So is ___this___ word.
diff --git a/test/resources/markdown.mdtest/Strong and em together.xhtml b/test/resources/markdown.mdtest/Strong and em together.xhtml
new file mode 100644
index 0000000..71ec78c
--- /dev/null
+++ b/test/resources/markdown.mdtest/Strong and em together.xhtml
@@ -0,0 +1,7 @@
+This is strong and em.
+
+So is this word.
+
+This is strong and em.
+
+So is this word.
diff --git a/test/resources/markdown.mdtest/Tabs.text b/test/resources/markdown.mdtest/Tabs.text
new file mode 100644
index 0000000..589d113
--- /dev/null
+++ b/test/resources/markdown.mdtest/Tabs.text
@@ -0,0 +1,21 @@
++ this is a list item
+ indented with tabs
+
++ this is a list item
+ indented with spaces
+
+Code:
+
+ this code block is indented by one tab
+
+And:
+
+ this code block is indented by two tabs
+
+And:
+
+ + this is an example list item
+ indented with tabs
+
+ + this is an example list item
+ indented with spaces
diff --git a/test/resources/markdown.mdtest/Tabs.xhtml b/test/resources/markdown.mdtest/Tabs.xhtml
new file mode 100644
index 0000000..3301ba8
--- /dev/null
+++ b/test/resources/markdown.mdtest/Tabs.xhtml
@@ -0,0 +1,25 @@
+
+
+Code:
+
+this code block is indented by one tab
+
+
+And:
+
+ this code block is indented by two tabs
+
+
+And:
+
++ this is an example list item
+ indented with tabs
+
++ this is an example list item
+ indented with spaces
+
diff --git a/test/resources/markdown.mdtest/Tidyness.text b/test/resources/markdown.mdtest/Tidyness.text
new file mode 100644
index 0000000..5f18b8d
--- /dev/null
+++ b/test/resources/markdown.mdtest/Tidyness.text
@@ -0,0 +1,5 @@
+> A list within a blockquote:
+>
+> * asterisk 1
+> * asterisk 2
+> * asterisk 3
diff --git a/test/resources/markdown.mdtest/Tidyness.xhtml b/test/resources/markdown.mdtest/Tidyness.xhtml
new file mode 100644
index 0000000..f2a8ce7
--- /dev/null
+++ b/test/resources/markdown.mdtest/Tidyness.xhtml
@@ -0,0 +1,8 @@
+
+A list within a blockquote:
+
+- asterisk 1
+- asterisk 2
+- asterisk 3
+
+
diff --git a/test/resources/php-markdown-extra.mdtest/Abbr.text b/test/resources/php-markdown-extra.mdtest/Abbr.text
new file mode 100644
index 0000000..ae72f4e
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Abbr.text
@@ -0,0 +1,31 @@
+Some text about HTML, SGML and HTML4.
+
+Let's talk about the U.S.A., (É.U. or É.-U. d'A. in French).
+
+*[HTML4]: Hyper Text Markup Language version 4
+*[HTML]: Hyper Text Markup Language
+*[SGML]: Standard Generalized Markup Language
+*[U.S.A.]: United States of America
+*[É.U.] : États-Unis d'Amérique
+*[É.-U. d'A.] : États-Unis d'Amérique
+
+And here we have a CD, some CDs, and some other CD's.
+
+*[CD]: Compact Disk
+
+Let's transfert documents through TCP/IP, using TCP packets.
+
+*[IP]: Internet Protocol
+*[TCP]: Transmission Control Protocol
+
+ ---
+
+Bienvenue sur [CMS](http://www.bidulecms.com "Bidule CMS").
+
+*[CMS]: Content Management System
+
+ ---
+
+ATCCE
+
+*[ATCCE]: Abbreviation "Testing" Correct 'Character' < Escapes >
\ No newline at end of file
diff --git a/test/resources/php-markdown-extra.mdtest/Abbr.xhtml b/test/resources/php-markdown-extra.mdtest/Abbr.xhtml
new file mode 100644
index 0000000..8beaa2e
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Abbr.xhtml
@@ -0,0 +1,15 @@
+Some text about HTML, SGML and HTML4.
+
+Let's talk about the U.S.A., (É.U. or É.-U. d'A. in French).
+
+And here we have a CD, some CDs, and some other CD's.
+
+Let's transfert documents through TCP/IP, using TCP packets.
+
+
+
+Bienvenue sur CMS.
+
+
+
+ATCCE
diff --git a/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.text b/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.text
new file mode 100644
index 0000000..106a3ad
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.text
@@ -0,0 +1,69 @@
+``` .html
+
+ - Code block first in file
+ - doesn't work under some circumstances
+
+```
+
+As above: checking for bad interractions with the HTML block parser:
+
+``` html
+
+```
+
+Some *markdown* `formatting`.
+
+``` html
+
+```
+
+Some *markdown*
+
+```
+
+
+```
+
+```
+function test();
+```
+
+
+
+
+
+
+
+```
+
+
+```
+
+
+Two code blocks with no blank line between them:
+
+```
+
+```
+```
+
+```
+
+Testing *confusion* with code spans at the HTML block parser:
+
+```
+
```
+```
+
+Testing mixing with title code blocks
+
+```
+
```
+~~~
+
```
+```
+~~~
+
```
+```
+
```
+~~~
diff --git a/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.xhtml b/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.xhtml
new file mode 100644
index 0000000..c66ec31
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.xhtml
@@ -0,0 +1,61 @@
+
<ul>
+ <li>Code block first in file</li>
+ <li>doesn't work under some circumstances</li>
+</ul>
+
+
+
As above: checking for bad interractions with the HTML block parser:
+
+
<div>
+
+
+
Some markdownformatting.
+
+
</div>
+
+
+
Some markdown
+
+
<div>
+ <html>
+
+
+
function test();
+
+
+
+
+
+
+
Two code blocks with no blank line between them:
+
+
<div>
+
+
+
<div>
+
+
+
Testing confusion with code spans at the HTML block parser:
+
+
<div>```</div>
+
+
+
Testing mixing with title code blocks
+
+
<p>```
+~~~
+<p>```
+
+
+
<p>```
+```
+<p>```
+
diff --git a/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.text b/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.text
new file mode 100644
index 0000000..78b7fa4
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.text
@@ -0,0 +1,123 @@
+```
+
+```
+
+Code block starting and ending with empty lines:
+```
+
+
+
+
+
+```
+
+Indented code block containing fenced code block sample:
+
+ ```
+
+ ```
+
+Fenced code block with indented code block sample:
+
+```
+Some text
+
+ Indented code block sample code
+```
+
+Fenced code block with long markers:
+
+``````````````````
+Fenced
+``````````````````
+
+Fenced code block with fenced code block markers of different length in it:
+
+````
+In code block
+```
+Still in code block
+`````
+Still in code block
+````
+
+Fenced code block with Markdown header and horizontal rule:
+
+```
+#test
+---
+```
+
+Fenced code block with link definitions, footnote definition and
+abbreviation definitions:
+
+```
+[example]: http://example.com/
+
+[^1]: Footnote def
+
+*[HTML]: HyperText Markup Language
+```
+
+* In a list item with smalish indent:
+
+ `````
+ #!/bin/sh
+ #
+ # Preload driver binary
+ LD_PRELOAD=libusb-driver.so $0.bin $*
+ `````
+
+With HTML content.
+
+`````
+bold
+`````
+
+Bug with block level elements in this case:
+```
+
+
+```
+
+Indented code block of a fenced code block:
+
+ ```
+ haha!
+ ```
+
+With class:
+
+`````html
+bold
+`````
+
+````` html
+bold
+`````
+
+`````.html
+bold
+`````
+
+````` .html
+bold
+`````
+
+With extra attribute block:
+
+`````{.html}
+bold
+`````
+
+````` {.html #codeid}
+bold
+`````
+
+````` .html{.bold}
+
+`````
+
+`````` .html {#codeid}
+
+``````
\ No newline at end of file
diff --git a/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.xhtml b/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.xhtml
new file mode 100644
index 0000000..ef23e1f
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.xhtml
@@ -0,0 +1,109 @@
+<Fenced>
+
+
+Code block starting and ending with empty lines:
+
+
<Fenced>
+
+
+
+
+Indented code block containing fenced code block sample:
+
+```
+<Fenced>
+```
+
+
+Fenced code block with indented code block sample:
+
+Some text
+
+ Indented code block sample code
+
+
+Fenced code block with long markers:
+
+Fenced
+
+
+Fenced code block with fenced code block markers of different length in it:
+
+In code block
+```
+Still in code block
+`````
+Still in code block
+
+
+Fenced code block with Markdown header and horizontal rule:
+
+#test
+---
+
+
+Fenced code block with link definitions, footnote definition and
+abbreviation definitions:
+
+[example]: http://example.com/
+
+[^1]: Footnote def
+
+*[HTML]: HyperText Markup Language
+
+
+
+
+With HTML content.
+
+<b>bold</b>
+
+
+Bug with block level elements in this case:
+ <div>
+ </div>
+
+
+Indented code block of a fenced code block:
+
+```
+haha!
+```
+
+
+With class:
+
+<b>bold</b>
+
+
+<b>bold</b>
+
+
+<b>bold</b>
+
+
+<b>bold</b>
+
+
+With extra attribute block:
+
+<b>bold</b>
+
+
+<b>bold</b>
+
+
+<div>
+
+
+</div>
+
diff --git a/test/resources/php-markdown-extra.mdtest/Definition Lists.text b/test/resources/php-markdown-extra.mdtest/Definition Lists.text
new file mode 100644
index 0000000..5b3bdb6
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Definition Lists.text
@@ -0,0 +1,115 @@
+A simple definition list:
+
+Term 1
+: Definition 1
+
+Term 2
+: Definition 2
+
+With multiple terms:
+
+Term 1
+Term 2
+: Definition 1
+
+Term 3
+Term 4
+: Definition 2
+
+With multiple definitions:
+
+Term 1
+: Definition 1
+: Definition 2
+
+Term 2
+: Definition 3
+: Definition 4
+
+With multiple lines per definition:
+
+Term 1
+: Definition 1 line 1 ...
+Definition 1 line 2
+: Definition 2 line 1 ...
+Definition 2 line 2
+
+Term 2
+: Definition 3 line 2 ...
+ Definition 3 line 2
+: Definition 4 line 2 ...
+ Definition 4 line 2
+
+With paragraphs:
+
+Term 1
+
+: Definition 1 (paragraph)
+
+Term 2
+
+: Definition 2 (paragraph)
+
+With multiple paragraphs:
+
+Term 1
+
+: Definition 1 paragraph 1 line 1 ...
+ Definition 1 paragraph 1 line 2
+
+ Definition 1 paragraph 2 line 1 ...
+ Definition 1 paragraph 2 line 2
+
+Term 2
+
+: Definition 1 paragraph 1 line 1 ...
+Definition 1 paragraph 1 line 2 (lazy)
+
+ Definition 1 paragraph 2 line 1 ...
+Definition 1 paragraph 2 line 2 (lazy)
+
+* * *
+
+A mix:
+
+Term 1
+Term 2
+
+: Definition 1 paragraph 1 line 1 ...
+Definition 1 paragraph 1 line 2 (lazy)
+
+ Definition 1 paragraph 2 line 1 ...
+ Definition 1 paragraph 2 line 2
+
+: Definition 2 paragraph 1 line 1 ...
+Definition 2 paragraph 1 line 2 (lazy)
+
+Term 3
+: Definition 3 (no paragraph)
+: Definition 4 (no paragraph)
+: Definition 5 line 1 ...
+ Definition 5 line 2 (no paragraph)
+
+: Definition 6 paragraph 1 line 1 ...
+Definition 6 paragraph 1 line 2
+: Definition 7 (no paragraph)
+: Definition 8 paragraph 1 line 1 (forced paragraph) ...
+ Definition 8 paragraph 1 line 2
+
+ Definition 8 paragraph 2 line 1
+
+Term 4
+: Definition 9 paragraph 1 line 1 (forced paragraph) ...
+ Definition 9 paragraph 1 line 2
+
+ Definition 9 paragraph 2 line 1
+: Definition 10 (no paragraph)
+
+* * *
+
+Special cases:
+
+Term
+
+: code block
+ as first element of a definition
\ No newline at end of file
diff --git a/test/resources/php-markdown-extra.mdtest/Definition Lists.xhtml b/test/resources/php-markdown-extra.mdtest/Definition Lists.xhtml
new file mode 100644
index 0000000..f99f456
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Definition Lists.xhtml
@@ -0,0 +1,155 @@
+A simple definition list:
+
+
+- Term 1
+- Definition 1
+
+- Term 2
+- Definition 2
+
+
+With multiple terms:
+
+
+- Term 1
+- Term 2
+- Definition 1
+
+- Term 3
+- Term 4
+- Definition 2
+
+
+With multiple definitions:
+
+
+- Term 1
+- Definition 1
+
+- Definition 2
+
+- Term 2
+- Definition 3
+
+- Definition 4
+
+
+With multiple lines per definition:
+
+
+- Term 1
+- Definition 1 line 1 ...
+Definition 1 line 2
+
+- Definition 2 line 1 ...
+Definition 2 line 2
+
+- Term 2
+- Definition 3 line 2 ...
+Definition 3 line 2
+
+- Definition 4 line 2 ...
+Definition 4 line 2
+
+
+With paragraphs:
+
+
+- Term 1
+-
+
Definition 1 (paragraph)
+
+
+- Term 2
+-
+
Definition 2 (paragraph)
+
+
+
+With multiple paragraphs:
+
+
+- Term 1
+-
+
Definition 1 paragraph 1 line 1 ...
+Definition 1 paragraph 1 line 2
+
+Definition 1 paragraph 2 line 1 ...
+Definition 1 paragraph 2 line 2
+
+
+- Term 2
+-
+
Definition 1 paragraph 1 line 1 ...
+Definition 1 paragraph 1 line 2 (lazy)
+
+Definition 1 paragraph 2 line 1 ...
+Definition 1 paragraph 2 line 2 (lazy)
+
+
+
+
+
+A mix:
+
+
+- Term 1
+- Term 2
+-
+
Definition 1 paragraph 1 line 1 ...
+Definition 1 paragraph 1 line 2 (lazy)
+
+Definition 1 paragraph 2 line 1 ...
+Definition 1 paragraph 2 line 2
+
+
+-
+
Definition 2 paragraph 1 line 1 ...
+Definition 2 paragraph 1 line 2 (lazy)
+
+
+- Term 3
+- Definition 3 (no paragraph)
+
+- Definition 4 (no paragraph)
+
+- Definition 5 line 1 ...
+Definition 5 line 2 (no paragraph)
+
+-
+
Definition 6 paragraph 1 line 1 ...
+Definition 6 paragraph 1 line 2
+
+
+- Definition 7 (no paragraph)
+
+-
+
Definition 8 paragraph 1 line 1 (forced paragraph) ...
+Definition 8 paragraph 1 line 2
+
+Definition 8 paragraph 2 line 1
+
+
+- Term 4
+-
+
Definition 9 paragraph 1 line 1 (forced paragraph) ...
+Definition 9 paragraph 1 line 2
+
+Definition 9 paragraph 2 line 1
+
+
+- Definition 10 (no paragraph)
+
+
+
+
+Special cases:
+
+
+- Term
+-
+
code block
+as first element of a definition
+
+
+
diff --git a/test/resources/php-markdown-extra.mdtest/Emphasis.text b/test/resources/php-markdown-extra.mdtest/Emphasis.text
new file mode 100644
index 0000000..816859c
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Emphasis.text
@@ -0,0 +1,100 @@
+Combined emphasis:
+
+1. ***test test***
+2. ___test test___
+3. *test **test***
+4. **test *test***
+5. ***test* test**
+6. ***test** test*
+7. ***test* test**
+8. **test *test***
+9. *test **test***
+10. _test __test___
+11. __test _test___
+12. ___test_ test__
+13. ___test__ test_
+14. ___test_ test__
+15. __test _test___
+16. _test __test___
+17. *test __test__*
+18. **test _test_**
+19. **_test_ test**
+20. *__test__ test*
+21. **_test_ test**
+22. **test _test_**
+23. *test __test__*
+24. _test **test**_
+25. __test *test*__
+26. __*test* test__
+27. _**test** test_
+28. __*test* test__
+29. __test *test*__
+30. _test **test**_
+
+
+Incorrect nesting:
+
+1. *test **test* test**
+2. _test __test_ test__
+3. **test *test** test*
+4. __test _test__ test_
+5. *test *test* test*
+6. _test _test_ test_
+7. **test **test** test**
+8. __test __test__ test__
+9. _**some text_**
+10. *__some text*__
+11. **_some text**_
+12. *__some text*__
+
+No emphasis:
+
+1. test* test *test
+2. test** test **test
+3. test_ test _test
+4. test__ test __test
+
+
+
+Middle-word emphasis (asterisks):
+
+1. *a*b
+2. a*b*
+3. a*b*c
+4. **a**b
+5. a**b**
+6. a**b**c
+
+
+Middle-word emphasis (underscore):
+
+1. _a_b
+2. a_b_
+3. a_b_c
+4. __a__b
+5. a__b__
+6. a__b__c
+
+my_precious_file.txt
+
+
+## Tricky Cases
+
+E**. **Test** TestTestTest
+
+E**. **Test** Test Test Test
+
+
+## Overlong emphasis
+
+Name: ____________
+Organization: ____
+Region/Country: __
+
+_____Cut here_____
+
+____Cut here____
+
+# Regression
+
+_**Note**_: This _is emphasis_.
diff --git a/test/resources/php-markdown-extra.mdtest/Emphasis.xhtml b/test/resources/php-markdown-extra.mdtest/Emphasis.xhtml
new file mode 100644
index 0000000..315280f
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Emphasis.xhtml
@@ -0,0 +1,106 @@
+Combined emphasis:
+
+
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+
+
+Incorrect nesting:
+
+
+- *test test* test
+- _test test_ test
+- test *test test*
+- test _test test_
+- test *test test*
+- test _test test_
+- test **test test**
+- test __test test__
+- _some text_
+- *some text*
+- _some text_
+- *some text*
+
+
+No emphasis:
+
+
+- test* test *test
+- test** test **test
+- test_ test _test
+- test__ test __test
+
+
+Middle-word emphasis (asterisks):
+
+
+- ab
+- ab
+- abc
+- ab
+- ab
+- abc
+
+
+Middle-word emphasis (underscore):
+
+
+- _a_b
+- a_b_
+- a_b_c
+- __a__b
+- a__b__
+- a__b__c
+
+
+my_precious_file.txt
+
+Tricky Cases
+
+E**. Test TestTestTest
+
+E**. Test Test Test Test
+
+
+Overlong emphasis
+
+Name: ____________
+Organization: ____
+Region/Country: __
+
+_____Cut here_____
+
+____Cut here____
+
+
+Regression
+
+Note: This is emphasis.
\ No newline at end of file
diff --git a/test/resources/php-markdown-extra.mdtest/Footnotes.text b/test/resources/php-markdown-extra.mdtest/Footnotes.text
new file mode 100644
index 0000000..95b5ea8
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Footnotes.text
@@ -0,0 +1,70 @@
+This is the first paragraph.[^first]
+
+[^first]: This is the first note.
+
+* List item one.[^second]
+* List item two.[^third]
+
+[^third]: This is the third note, defined out of order.
+[^second]: This is the second note.
+[^fourth]: This is the fourth note.
+
+# Header[^fourth]
+
+Some paragraph with a footnote[^1], and another[^2].
+
+[^1]: Content for fifth footnote.
+[^2]: Content for sixth footnote spaning on
+ three lines, with some span-level markup like
+ _emphasis_, a [link][].
+
+[link]: http://michelf.ca/
+
+Another paragraph with a named footnote[^fn-name].
+
+[^fn-name]:
+ Footnote beginning on the line next to the marker.
+
+This paragraph should not have a footnote marker since
+the footnote is undefined.[^3]
+
+This paragraph has a second footnote marker to footnote number one.[^1]
+
+This paragraph links to a footnote with plenty of
+block-level content.[^block]
+
+[^block]:
+ Paragraph.
+
+ * List item
+
+ > Blockquote
+
+ Code block
+
+This paragraph host the footnote reference within a
+footnote test[^reference].
+
+[^reference]:
+ This footnote has a footnote of its own.[^nested]
+
+[^nested]:
+ This footnote should appear even though it is referenced
+ from another footnote. But [^reference] should be litteral
+ since the footnote with that name has already been used.
+
+ - - -
+
+Testing unusual footnote name[^1$^!"'].
+
+[^1$^!"']: Haha!
+
+ - - -
+
+Footnotes mixed with images[^image-mixed]
+![1800 Travel][img6]
+![1830 Travel][img7]
+
+[img6]: images/MGR-1800-travel.jpeg "Travel Speeds in 1800"
+[^image-mixed]: Footnote Content
+[img7]: images/MGR-1830-travel.jpeg "Travel Speeds in 1830"
diff --git a/test/resources/php-markdown-extra.mdtest/Footnotes.xhtml b/test/resources/php-markdown-extra.mdtest/Footnotes.xhtml
new file mode 100644
index 0000000..fe0a464
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Footnotes.xhtml
@@ -0,0 +1,103 @@
+This is the first paragraph.
+
+
+- List item one.
+- List item two.
+
+
+Header
+
+Some paragraph with a footnote, and another.
+
+Another paragraph with a named footnote.
+
+This paragraph should not have a footnote marker since
+the footnote is undefined.[^3]
+
+This paragraph has a second footnote marker to footnote number one.
+
+This paragraph links to a footnote with plenty of
+block-level content.
+
+This paragraph host the footnote reference within a
+footnote test.
+
+
+
+Testing unusual footnote name.
+
+
+
+Footnotes mixed with images

+
+
diff --git a/test/resources/php-markdown-extra.mdtest/Headers with attributes.text b/test/resources/php-markdown-extra.mdtest/Headers with attributes.text
new file mode 100644
index 0000000..4242136
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Headers with attributes.text
@@ -0,0 +1,41 @@
+Header {#id1}
+======
+
+Header { #id2}
+------
+
+### Header {#id3 }
+#### Header ## { #id4 }
+
+ - - -
+
+Header {.cl}
+======
+
+Header { .cl}
+------
+
+### Header {.cl }
+#### Header ## { .cl }
+
+ - - -
+
+Header {.cl.class}
+======
+
+Header { .cl .class}
+------
+
+### Header {.cl .class }
+#### Header ## { .cl.class }
+
+ - - -
+
+Header {#id5.cl.class}
+======
+
+Header { #id6 .cl .class}
+------
+
+### Header {.cl.class#id7 }
+#### Header ## { .cl.class#id8 }
diff --git a/test/resources/php-markdown-extra.mdtest/Headers with attributes.xhtml b/test/resources/php-markdown-extra.mdtest/Headers with attributes.xhtml
new file mode 100644
index 0000000..ce7139b
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Headers with attributes.xhtml
@@ -0,0 +1,37 @@
+Header
+
+Header
+
+Header
+
+Header
+
+
+
+Header
+
+Header
+
+Header
+
+Header
+
+
+
+Header
+
+Header
+
+Header
+
+Header
+
+
+
+Header
+
+Header
+
+Header
+
+Header
diff --git a/test/resources/php-markdown-extra.mdtest/Inline HTML with Markdown content.text b/test/resources/php-markdown-extra.mdtest/Inline HTML with Markdown content.text
new file mode 100644
index 0000000..b49b9b5
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Inline HTML with Markdown content.text
@@ -0,0 +1,110 @@
+# Markdown inside code blocks
+
+
+foo
+
+
+
+foo
+
+
+
+foo
+
+
+
+| test _emphasis_ (span) |
+
+
+
+| test _emphasis_ (span) |
+
+
+
+| test _emphasis_ (block) |
+
+
+## More complicated
+
+
+|
+* this is _not_ a list item |
+|
+* this is _not_ a list item |
+|
+* this _is_ a list item
+ |
+
+
+## With indent
+
+
+
+ This text is no code block: if it was, the
+ closing `
` would be too and the HTML block
+ would be invalid.
+
+ Markdown content in HTML blocks is assumed to be
+ indented the same as the block opening tag.
+
+ **This should be the third paragraph after the header.**
+
+
+
+## Code block with rogue `
`s in Markdown code span and block
+
+
+
+
+ This is a code block however:
+
+
+
+ Funny isn't it? Here is a code span: `
`.
+
+
+
+
+
+
+ * List item, not a code block
+
+Some text
+
+ This is a code block.
+
+
+
+## No code block in markdown span mode
+
+
+ This is not a code block since Markdown parse paragraph
+ content as span. Code spans like `
` are allowed though.
+
+
+
_Hello_ _world_
+
+
+line 1
+line 2
+line 3
+
+
+## Preserving attributes and tags on more than one line:
+
+
+Some _span_ content.
+
+
+
+## Header confusion bug
+
+
+
+| Hello World!
+============
+
+Hello World! |
+
+
diff --git a/test/resources/php-markdown-extra.mdtest/Inline HTML with Markdown content.xhtml b/test/resources/php-markdown-extra.mdtest/Inline HTML with Markdown content.xhtml
new file mode 100644
index 0000000..06a1fca
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Inline HTML with Markdown content.xhtml
@@ -0,0 +1,131 @@
+
Markdown inside code blocks
+
+
+
+
+
+
+
+
+
+
+
+
+|
+
+ test emphasis (block)
+
+ |
+
+
+
More complicated
+
+
+|
+* this is not a list item |
+|
+* this is not a list item |
+|
+
+
+
+ |
+
+
+
With indent
+
+
+
+
+
This text is no code block: if it was, the
+closing <div> would be too and the HTML block
+would be invalid.
+
+
Markdown content in HTML blocks is assumed to be
+indented the same as the block opening tag.
+
+
This should be the third paragraph after the header.
+
+
+
+
+
Code block with rogue </div>s in Markdown code span and block
+
+
+
+
+
This is a code block however:
+
+
</div>
+
+
+
Funny isn't it? Here is a code span: </div>.
+
+
+
+
+
+
+
+
+- List item, not a code block
+
+
+
Some text
+
+
This is a code block.
+
+
+
+
+
+
No code block in markdown span mode
+
+
+ This is not a code block since Markdown parse paragraph
+ content as span. Code spans like </p> are allowed though.
+
+
+
Hello world
+
+
+line 1
+line 2
+line 3
+
+
+
Preserving attributes and tags on more than one line:
+
+
+Some span content.
+
+
+
Header confusion bug
+
+
+
+| Hello World!
+============
+
+Hello World! |
+
+
diff --git a/test/resources/php-markdown-extra.mdtest/Link & Image Attributes.text b/test/resources/php-markdown-extra.mdtest/Link & Image Attributes.text
new file mode 100644
index 0000000..ee9b729
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Link & Image Attributes.text
@@ -0,0 +1,10 @@
+This is an [inline link](/url "title"){.class #inline-link}.
+
+This is a [reference link][refid].
+
+This is an {.class #inline-img}.
+
+This is a ![reference image][refid].
+
+[refid]: /path/to/something (Title) { .class #ref data-key=val }
+
diff --git a/test/resources/php-markdown-extra.mdtest/Link & Image Attributes.xhtml b/test/resources/php-markdown-extra.mdtest/Link & Image Attributes.xhtml
new file mode 100644
index 0000000..a59c0a4
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Link & Image Attributes.xhtml
@@ -0,0 +1,8 @@
+
This is an inline link.
+
+
This is a reference link.
+
+
This is an
.
+
+
This is a
.
+
diff --git a/test/resources/php-markdown-extra.mdtest/Tables.text b/test/resources/php-markdown-extra.mdtest/Tables.text
new file mode 100644
index 0000000..d60daac
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Tables.text
@@ -0,0 +1,113 @@
+# Simple tables
+
+Header 1 | Header 2
+--------- | ---------
+Cell 1 | Cell 2
+Cell 3 | Cell 4
+
+With leading pipes:
+
+| Header 1 | Header 2
+| --------- | ---------
+| Cell 1 | Cell 2
+| Cell 3 | Cell 4
+
+With tailing pipes:
+
+Header 1 | Header 2 |
+--------- | --------- |
+Cell 1 | Cell 2 |
+Cell 3 | Cell 4 |
+
+With leading and tailing pipes:
+
+| Header 1 | Header 2 |
+| --------- | --------- |
+| Cell 1 | Cell 2 |
+| Cell 3 | Cell 4 |
+
+* * *
+
+# One-column one-row table
+
+With leading pipes:
+
+| Header
+| -------
+| Cell
+
+With tailing pipes:
+
+Header |
+------- |
+Cell |
+
+With leading and tailing pipes:
+
+| Header |
+| ------- |
+| Cell |
+
+* * *
+
+Table alignement:
+
+| Default | Right | Center | Left |
+| --------- |:--------- |:---------:| ---------:|
+| Long Cell | Long Cell | Long Cell | Long Cell |
+| Cell | Cell | Cell | Cell |
+
+Table alignement (alternate spacing):
+
+| Default | Right | Center | Left |
+| --------- | :-------- | :-------: | --------: |
+| Long Cell | Long Cell | Long Cell | Long Cell |
+| Cell | Cell | Cell | Cell |
+
+* * *
+
+# Empty cells
+
+| Header 1 | Header 2 |
+| --------- | --------- |
+| A | B |
+| C | |
+
+Header 1 | Header 2
+--------- | ---------
+A | B
+ | D
+
+* * *
+
+# Missing tailing pipe
+
+Header 1 | Header 2
+--------- | --------- |
+Cell | Cell |
+Cell | Cell |
+
+Header 1 | Header 2 |
+--------- | ---------
+Cell | Cell |
+Cell | Cell |
+
+Header 1 | Header 2 |
+--------- | --------- |
+Cell | Cell
+Cell | Cell |
+
+Header 1 | Header 2 |
+--------- | --------- |
+Cell | Cell |
+Cell | Cell
+
+* * *
+
+# Too many pipes in rows
+
+| Header 1 | Header 2 |
+| ---------
+| Cell | Cell | Extra cell? |
+| Cell | Cell | Extra cell? |
+
diff --git a/test/resources/php-markdown-extra.mdtest/Tables.xhtml b/test/resources/php-markdown-extra.mdtest/Tables.xhtml
new file mode 100644
index 0000000..87fe8b3
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Tables.xhtml
@@ -0,0 +1,333 @@
+
Simple tables
+
+
+
+
+ | Header 1 |
+ Header 2 |
+
+
+
+
+ | Cell 1 |
+ Cell 2 |
+
+
+ | Cell 3 |
+ Cell 4 |
+
+
+
+
+
With leading pipes:
+
+
+
+
+ | Header 1 |
+ Header 2 |
+
+
+
+
+ | Cell 1 |
+ Cell 2 |
+
+
+ | Cell 3 |
+ Cell 4 |
+
+
+
+
+
With tailing pipes:
+
+
+
+
+ | Header 1 |
+ Header 2 |
+
+
+
+
+ | Cell 1 |
+ Cell 2 |
+
+
+ | Cell 3 |
+ Cell 4 |
+
+
+
+
+
With leading and tailing pipes:
+
+
+
+
+ | Header 1 |
+ Header 2 |
+
+
+
+
+ | Cell 1 |
+ Cell 2 |
+
+
+ | Cell 3 |
+ Cell 4 |
+
+
+
+
+
+
+
One-column one-row table
+
+
With leading pipes:
+
+
+
+
+ | Header |
+
+
+
+
+ | Cell |
+
+
+
+
+
With tailing pipes:
+
+
+
+
+ | Header |
+
+
+
+
+ | Cell |
+
+
+
+
+
With leading and tailing pipes:
+
+
+
+
+ | Header |
+
+
+
+
+ | Cell |
+
+
+
+
+
+
+
Table alignement:
+
+
+
+
+ | Default |
+ Right |
+ Center |
+ Left |
+
+
+
+
+ | Long Cell |
+ Long Cell |
+ Long Cell |
+ Long Cell |
+
+
+ | Cell |
+ Cell |
+ Cell |
+ Cell |
+
+
+
+
+
Table alignement (alternate spacing):
+
+
+
+
+ | Default |
+ Right |
+ Center |
+ Left |
+
+
+
+
+ | Long Cell |
+ Long Cell |
+ Long Cell |
+ Long Cell |
+
+
+ | Cell |
+ Cell |
+ Cell |
+ Cell |
+
+
+
+
+
+
+
Empty cells
+
+
+
+
+ | Header 1 |
+ Header 2 |
+
+
+
+
+ | A |
+ B |
+
+
+ | C |
+ |
+
+
+
+
+
+
+
+ | Header 1 |
+ Header 2 |
+
+
+
+
+ | A |
+ B |
+
+
+ |
+ D |
+
+
+
+
+
+
+
Missing tailing pipe
+
+
+
+
+ | Header 1 |
+ Header 2 |
+
+
+
+
+ | Cell |
+ Cell |
+
+
+ | Cell |
+ Cell |
+
+
+
+
+
+
+
+ | Header 1 |
+ Header 2 |
+
+
+
+
+ | Cell |
+ Cell |
+
+
+ | Cell |
+ Cell |
+
+
+
+
+
+
+
+ | Header 1 |
+ Header 2 |
+
+
+
+
+ | Cell |
+ Cell |
+
+
+ | Cell |
+ Cell |
+
+
+
+
+
+
+
+ | Header 1 |
+ Header 2 |
+
+
+
+
+ | Cell |
+ Cell |
+
+
+ | Cell |
+ Cell |
+
+
+
+
+
+
+
Too many pipes in rows
+
+
+
+
+ | Header 1 |
+ Header 2 |
+
+
+
+
+ | Cell |
+ Cell | Extra cell? |
+
+
+ | Cell |
+ Cell | Extra cell? |
+
+
+
diff --git a/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.text b/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.text
new file mode 100644
index 0000000..01504a4
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.text
@@ -0,0 +1,69 @@
+~~~ .html
+
+ - Code block first in file
+ - doesn't work under some circumstances
+
+~~~
+
+As above: checking for bad interractions with the HTML block parser:
+
+~~~ html
+
+~~~
+
+Some *markdown* `formatting`.
+
+~~~ html
+
+~~~
+
+Some *markdown*
+
+~~~
+
+
+~~~
+
+~~~
+function test();
+~~~
+
+
+
+
+
+
+
+~~~
+
+
+~~~
+
+
+Two code blocks with no blank line between them:
+
+~~~
+
+~~~
+~~~
+
+~~~
+
+Testing *confusion* with markers in the middle:
+
+~~~
+
~~~
+~~~
+
+Testing mixing with title code blocks
+
+~~~
+
```
+```
+
```
+~~~
+```
+
```
+~~~
+
```
+```
diff --git a/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.xhtml b/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.xhtml
new file mode 100644
index 0000000..0eabd27
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.xhtml
@@ -0,0 +1,61 @@
+
<ul>
+ <li>Code block first in file</li>
+ <li>doesn't work under some circumstances</li>
+</ul>
+
+
+
As above: checking for bad interractions with the HTML block parser:
+
+
<div>
+
+
+
Some markdownformatting.
+
+
</div>
+
+
+
Some markdown
+
+
<div>
+ <html>
+
+
+
function test();
+
+
+
+
+
+
+
Two code blocks with no blank line between them:
+
+
<div>
+
+
+
<div>
+
+
+
Testing confusion with markers in the middle:
+
+
<div>~~~</div>
+
+
+
Testing mixing with title code blocks
+
+
<p>```
+```
+<p>```
+
+
+
<p>```
+~~~
+<p>```
+
diff --git a/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.text b/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.text
new file mode 100644
index 0000000..e0d5730
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.text
@@ -0,0 +1,123 @@
+~~~
+
+~~~
+
+Code block starting and ending with empty lines:
+~~~
+
+
+
+
+
+~~~
+
+Indented code block containing fenced code block sample:
+
+ ~~~
+
+ ~~~
+
+Fenced code block with indented code block sample:
+
+~~~
+Some text
+
+ Indented code block sample code
+~~~
+
+Fenced code block with long markers:
+
+~~~~~~~~~~~~~~~~~~
+Fenced
+~~~~~~~~~~~~~~~~~~
+
+Fenced code block with fenced code block markers of different length in it:
+
+~~~~
+In code block
+~~~
+Still in code block
+~~~~~
+Still in code block
+~~~~
+
+Fenced code block with Markdown header and horizontal rule:
+
+~~~
+#test
+---
+~~~
+
+Fenced code block with link definitions, footnote definition and
+abbreviation definitions:
+
+~~~
+[example]: http://example.com/
+
+[^1]: Footnote def
+
+*[HTML]: HyperText Markup Language
+~~~
+
+* In a list item with smalish indent:
+
+ ~~~~~
+ #!/bin/sh
+ #
+ # Preload driver binary
+ LD_PRELOAD=libusb-driver.so $0.bin $*
+ ~~~~~
+
+With HTML content.
+
+~~~~~
+bold
+~~~~~
+
+Bug with block level elements in this case:
+~~~
+
+
+~~~
+
+Indented code block of a fenced code block:
+
+ ~~~
+ haha!
+ ~~~
+
+With class:
+
+~~~~~html
+bold
+~~~~~
+
+~~~~~ html
+bold
+~~~~~
+
+~~~~~.html
+bold
+~~~~~
+
+~~~~~ .html
+bold
+~~~~~
+
+With extra attribute block:
+
+~~~~~{.html}
+bold
+~~~~~
+
+~~~~~ {.html #codeid}
+bold
+~~~~~
+
+~~~~~ .html{.bold}
+
+~~~~~
+
+~~~~~ .html {#codeid}
+
+~~~~~
\ No newline at end of file
diff --git a/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.xhtml b/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.xhtml
new file mode 100644
index 0000000..e065a4d
--- /dev/null
+++ b/test/resources/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.xhtml
@@ -0,0 +1,109 @@
+<Fenced>
+
+
+Code block starting and ending with empty lines:
+
+
<Fenced>
+
+
+
+
+Indented code block containing fenced code block sample:
+
+~~~
+<Fenced>
+~~~
+
+
+Fenced code block with indented code block sample:
+
+Some text
+
+ Indented code block sample code
+
+
+Fenced code block with long markers:
+
+Fenced
+
+
+Fenced code block with fenced code block markers of different length in it:
+
+In code block
+~~~
+Still in code block
+~~~~~
+Still in code block
+
+
+Fenced code block with Markdown header and horizontal rule:
+
+#test
+---
+
+
+Fenced code block with link definitions, footnote definition and
+abbreviation definitions:
+
+[example]: http://example.com/
+
+[^1]: Footnote def
+
+*[HTML]: HyperText Markup Language
+
+
+
+
+With HTML content.
+
+<b>bold</b>
+
+
+Bug with block level elements in this case:
+ <div>
+ </div>
+
+
+Indented code block of a fenced code block:
+
+~~~
+haha!
+~~~
+
+
+With class:
+
+<b>bold</b>
+
+
+<b>bold</b>
+
+
+<b>bold</b>
+
+
+<b>bold</b>
+
+
+With extra attribute block:
+
+<b>bold</b>
+
+
+<b>bold</b>
+
+
+<div>
+
+
+</div>
+
diff --git a/test/resources/php-markdown.mdtest/Adjacent Lists.text b/test/resources/php-markdown.mdtest/Adjacent Lists.text
new file mode 100644
index 0000000..21876d3
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Adjacent Lists.text
@@ -0,0 +1,10 @@
+* one
+* two
+
+1. three
+2. four
+
+* one
+* two
+1. three
+2. four
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Adjacent Lists.xhtml b/test/resources/php-markdown.mdtest/Adjacent Lists.xhtml
new file mode 100644
index 0000000..ee7dfd8
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Adjacent Lists.xhtml
@@ -0,0 +1,19 @@
+
+
+
+- three
+- four
+
+
+
+
+
+- three
+- four
+
diff --git a/test/resources/php-markdown.mdtest/Auto Links.text b/test/resources/php-markdown.mdtest/Auto Links.text
new file mode 100644
index 0000000..4b10d32
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Auto Links.text
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Auto Links.xhtml b/test/resources/php-markdown.mdtest/Auto Links.xhtml
new file mode 100644
index 0000000..259c47f
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Auto Links.xhtml
@@ -0,0 +1,3 @@
+HTTP://WWW.SOMEURL.COM
+
+hr@company.com
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Backslash escapes.text b/test/resources/php-markdown.mdtest/Backslash escapes.text
new file mode 100644
index 0000000..a5e769b
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Backslash escapes.text
@@ -0,0 +1 @@
+Tricky combinaisons:
backslash with \\-- two dashes
backslash with \\> greater than
\\\[test](not a link)
\\\*no emphasis*
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Backslash escapes.xhtml b/test/resources/php-markdown.mdtest/Backslash escapes.xhtml
new file mode 100644
index 0000000..08fb8ef
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Backslash escapes.xhtml
@@ -0,0 +1 @@
+Tricky combinaisons:
backslash with \-- two dashes
backslash with \> greater than
\[test](not a link)
\*no emphasis*
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Code Spans.text b/test/resources/php-markdown.mdtest/Code Spans.text
new file mode 100644
index 0000000..43f2bcf
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Code Spans.text
@@ -0,0 +1,6 @@
+From ``
+on two lines.
+
+From ``
+on three lines.
diff --git a/test/resources/php-markdown.mdtest/Code Spans.xhtml b/test/resources/php-markdown.mdtest/Code Spans.xhtml
new file mode 100644
index 0000000..9ed0df8
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Code Spans.xhtml
@@ -0,0 +1,6 @@
+From <!-- to -->
+on two lines.
+
+From <!--
+to -->
+on three lines.
diff --git a/test/resources/php-markdown.mdtest/Code block in a list item.text b/test/resources/php-markdown.mdtest/Code block in a list item.text
new file mode 100644
index 0000000..5093348
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Code block in a list item.text
@@ -0,0 +1,15 @@
+
+* List Item:
+
+ code block
+
+ with a blank line
+
+ within a list item.
+
+* code block
+ as first element of a list item
+
+* List Item:
+
+ code block with whitespace on preceding line
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Code block in a list item.xhtml b/test/resources/php-markdown.mdtest/Code block in a list item.xhtml
new file mode 100644
index 0000000..361c1ae
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Code block in a list item.xhtml
@@ -0,0 +1,18 @@
+
+List Item:
+
+code block
+
+with a blank line
+
+
+within a list item.
+code block
+as first element of a list item
+
+
+List Item:
+
+code block with whitespace on preceding line
+
+
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Code block on second line.text b/test/resources/php-markdown.mdtest/Code block on second line.text
new file mode 100644
index 0000000..b7fcd97
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Code block on second line.text
@@ -0,0 +1,2 @@
+
+ Codeblock on second line
diff --git a/test/resources/php-markdown.mdtest/Code block on second line.xhtml b/test/resources/php-markdown.mdtest/Code block on second line.xhtml
new file mode 100644
index 0000000..25abb16
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Code block on second line.xhtml
@@ -0,0 +1,2 @@
+Codeblock on second line
+
diff --git a/test/resources/php-markdown.mdtest/Code block regressions.text b/test/resources/php-markdown.mdtest/Code block regressions.text
new file mode 100644
index 0000000..7728142
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Code block regressions.text
@@ -0,0 +1,15 @@
+
+
+foo `bar`
+
+
+
+lorem ipsum
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Code block regressions.xhtml b/test/resources/php-markdown.mdtest/Code block regressions.xhtml
new file mode 100644
index 0000000..41234de
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Code block regressions.xhtml
@@ -0,0 +1,18 @@
+<?php
+echo "hello!";
+?>
+
+
+foo bar
+
+<?php
+echo "hello!";
+
+
+lorem ipsum
+
+echo "hello!";
+?>
+
+
+lorem ipsum
diff --git a/test/resources/php-markdown.mdtest/Email auto links.text b/test/resources/php-markdown.mdtest/Email auto links.text
new file mode 100644
index 0000000..592e7d5
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Email auto links.text
@@ -0,0 +1,24 @@
+
+
+International domain names:
+
+
+## Some weird valid email addresses
+
+
+
+<1234567890@example.com>
+
+<_______@example.com>
+
+
+
+ (all of these characters are allowed)
+
+<"abc@def"@example.com> (anything goes inside quotation marks)
+
+<"Fred Bloggs"@example.com>
+
+
+
+<"A"@example.com>
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Email auto links.xhtml b/test/resources/php-markdown.mdtest/Email auto links.xhtml
new file mode 100644
index 0000000..2994823
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Email auto links.xhtml
@@ -0,0 +1,23 @@
+michel.fortin@michelf.ca
+
+International domain names: help@tūdaliņ.lv
+
+Some weird valid email addresses
+
+abc.123@example.com
+
+1234567890@example.com
+
+_______@example.com
+
+abc+mailbox/department=shipping@example.com
+
+!#$%&'*+-/=?^_`.{|}~@example.com (all of these characters are allowed)
+
+"abc@def"@example.com (anything goes inside quotation marks)
+
+"Fred Bloggs"@example.com
+
+jsmith@[192.0.2.1]
+
+"A"@example.com
diff --git a/test/resources/php-markdown.mdtest/Emphasis.text b/test/resources/php-markdown.mdtest/Emphasis.text
new file mode 100644
index 0000000..ff144b8
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Emphasis.text
@@ -0,0 +1,101 @@
+Combined emphasis:
+
+1. ***test test***
+2. ___test test___
+3. *test **test***
+4. **test *test***
+5. ***test* test**
+6. ***test** test*
+7. ***test* test**
+8. **test *test***
+9. *test **test***
+10. _test __test___
+11. __test _test___
+12. ___test_ test__
+13. ___test__ test_
+14. ___test_ test__
+15. __test _test___
+16. _test __test___
+17. *test __test__*
+18. **test _test_**
+19. **_test_ test**
+20. *__test__ test*
+21. **_test_ test**
+22. **test _test_**
+23. *test __test__*
+24. _test **test**_
+25. __test *test*__
+26. __*test* test__
+27. _**test** test_
+28. __*test* test__
+29. __test *test*__
+30. _test **test**_
+
+
+Incorrect nesting:
+
+1. *test **test* test**
+2. _test __test_ test__
+3. **test *test** test*
+4. __test _test__ test_
+5. *test *test* test*
+6. _test _test_ test_
+7. **test **test** test**
+8. __test __test__ test__
+9. _**some text_**
+10. *__some text*__
+11. **_some text**_
+12. *__some text*__
+
+
+No emphasis:
+
+1. test* test *test
+2. test** test **test
+3. test_ test _test
+4. test__ test __test
+
+
+
+Middle-word emphasis (asterisks):
+
+1. *a*b
+2. a*b*
+3. a*b*c
+4. **a**b
+5. a**b**
+6. a**b**c
+
+
+Middle-word emphasis (underscore):
+
+1. _a_b
+2. a_b_
+3. a_b_c
+4. __a__b
+5. a__b__
+6. a__b__c
+
+my_precious_file.txt
+
+
+## Tricky Cases
+
+E**. **Test** TestTestTest
+
+E**. **Test** Test Test Test
+
+
+## Overlong emphasis
+
+Name: ____________
+Organization: ____
+Region/Country: __
+
+_____Cut here_____
+
+____Cut here____
+
+# Regression
+
+_**Note**_: This _is emphasis_.
diff --git a/test/resources/php-markdown.mdtest/Emphasis.xhtml b/test/resources/php-markdown.mdtest/Emphasis.xhtml
new file mode 100644
index 0000000..8be015f
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Emphasis.xhtml
@@ -0,0 +1,105 @@
+Combined emphasis:
+
+
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+- test test
+
+
+Incorrect nesting:
+
+
+- *test test* test
+- _test test_ test
+- test *test test*
+- test _test test_
+- test *test test*
+- test _test test_
+- test **test test**
+- test __test test__
+- _some text_
+- *some text*
+- _some text_
+- *some text*
+
+
+No emphasis:
+
+
+- test* test *test
+- test** test **test
+- test_ test _test
+- test__ test __test
+
+
+Middle-word emphasis (asterisks):
+
+
+- ab
+- ab
+- abc
+- ab
+- ab
+- abc
+
+
+Middle-word emphasis (underscore):
+
+
+- ab
+- ab
+- abc
+- ab
+- ab
+- abc
+
+
+mypreciousfile.txt
+
+Tricky Cases
+
+E**. Test TestTestTest
+
+E**. Test Test Test Test
+
+
+Overlong emphasis
+
+Name: ____________
+Organization: ____
+Region/Country: __
+
+_____Cut here_____
+
+____Cut here____
+
+Regression
+
+Note: This is emphasis.
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Empty List Item.text b/test/resources/php-markdown.mdtest/Empty List Item.text
new file mode 100644
index 0000000..3c4edba
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Empty List Item.text
@@ -0,0 +1,35 @@
+With asterisks
+
+ * List item
+ *
+ * List item
+
+With numbers
+
+1. List item
+2.
+3. List item
+
+With hyphens
+
+- List item
+-
+- List item
+
+With asterisks
+
+ * List item
+ * List item
+ *
+
+With numbers
+
+1. List item
+2. List item
+3.
+
+With hyphens
+
+- List item
+- List item
+-
diff --git a/test/resources/php-markdown.mdtest/Empty List Item.xhtml b/test/resources/php-markdown.mdtest/Empty List Item.xhtml
new file mode 100644
index 0000000..02d86ed
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Empty List Item.xhtml
@@ -0,0 +1,47 @@
+With asterisks
+
+
+- List item
+
+- List item
+
+
+With numbers
+
+
+- List item
+
+- List item
+
+
+With hyphens
+
+
+- List item
+
+- List item
+
+
+With asterisks
+
+
+- List item
+- List item
+
+
+
+With numbers
+
+
+- List item
+- List item
+
+
+
+With hyphens
+
+
+- List item
+- List item
+
+
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Headers.text b/test/resources/php-markdown.mdtest/Headers.text
new file mode 100644
index 0000000..3a39174
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Headers.text
@@ -0,0 +1,9 @@
+Header
======
Header
------
### Header
+
+ - - -
+
+Header
======
Paragraph
Header
------
Paragraph
### Header
Paragraph
+
+ - - -
+
+Paragraph
Header
======
Paragraph
Paragraph
Header
------
Paragraph
Paragraph
### Header
Paragraph
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Headers.xhtml b/test/resources/php-markdown.mdtest/Headers.xhtml
new file mode 100644
index 0000000..3adb470
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Headers.xhtml
@@ -0,0 +1,39 @@
+Header
+
+Header
+
+Header
+
+
+
+Header
+
+Paragraph
+
+Header
+
+Paragraph
+
+Header
+
+Paragraph
+
+
+
+Paragraph
+
+Header
+
+Paragraph
+
+Paragraph
+
+Header
+
+Paragraph
+
+Paragraph
+
+Header
+
+Paragraph
diff --git a/test/resources/php-markdown.mdtest/Horizontal Rules.text b/test/resources/php-markdown.mdtest/Horizontal Rules.text
new file mode 100644
index 0000000..8e2da0b
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Horizontal Rules.text
@@ -0,0 +1,29 @@
+Horizontal rules:
+
+- - -
+
+* * *
+
+***
+
+---
+
+___
+
+Not horizontal rules (testing for a bug in 1.0.1j):
+
++++
+
+,,,
+
+===
+
+???
+
+AAA
+
+jjj
+
+j j j
+
+n n n
diff --git a/test/resources/php-markdown.mdtest/Horizontal Rules.xhtml b/test/resources/php-markdown.mdtest/Horizontal Rules.xhtml
new file mode 100644
index 0000000..b9170b1
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Horizontal Rules.xhtml
@@ -0,0 +1,30 @@
+Horizontal rules:
+
+
+
+
+
+
+
+
+
+
+
+Not horizontal rules (testing for a bug in 1.0.1j):
+
++++
+
+,,,
+
+===
+
+???
+
+AAA
+
+jjj
+
+j j j
+
+n n n
+
diff --git a/test/resources/php-markdown.mdtest/Inline HTML (Simple).html b/test/resources/php-markdown.mdtest/Inline HTML (Simple).html
new file mode 100644
index 0000000..1451d62
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Inline HTML (Simple).html
@@ -0,0 +1,25 @@
+With some attributes:
+
+
+ foo
+
+
+
+ foo
+
+
+Hr's:
+
+
+
+Regression:
+
+
+#test
+
+
+Hello
+Michael
+E.
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Inline HTML (Simple).text b/test/resources/php-markdown.mdtest/Inline HTML (Simple).text
new file mode 100644
index 0000000..359b622
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Inline HTML (Simple).text
@@ -0,0 +1,25 @@
+With some attributes:
+
+
+ foo
+
+
+
+ foo
+
+
+Hr's:
+
+
+
+Regression:
+
+
+#test
+
+
+Hello
+Michael
+E.
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Inline HTML (Span).text b/test/resources/php-markdown.mdtest/Inline HTML (Span).text
new file mode 100644
index 0000000..19028bb
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Inline HTML (Span).text
@@ -0,0 +1,4 @@
+ACINACS
+
+SB
+SB
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Inline HTML (Span).xhtml b/test/resources/php-markdown.mdtest/Inline HTML (Span).xhtml
new file mode 100644
index 0000000..4d18aff
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Inline HTML (Span).xhtml
@@ -0,0 +1,4 @@
+ACINACS
+
+SB
+SB
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Inline HTML comments.html b/test/resources/php-markdown.mdtest/Inline HTML comments.html
new file mode 100644
index 0000000..b45f014
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Inline HTML comments.html
@@ -0,0 +1,9 @@
+Paragraph one.
+
+
+
+Paragraph two.
+
+
+
+The end.
diff --git a/test/resources/php-markdown.mdtest/Inline HTML comments.text b/test/resources/php-markdown.mdtest/Inline HTML comments.text
new file mode 100644
index 0000000..d57d00a
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Inline HTML comments.text
@@ -0,0 +1,9 @@
+Paragraph one.
+
+
+
+Paragraph two.
+
+
+
+The end.
diff --git a/test/resources/php-markdown.mdtest/Ins & del.text b/test/resources/php-markdown.mdtest/Ins & del.text
new file mode 100644
index 0000000..2d54c66
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Ins & del.text
@@ -0,0 +1,17 @@
+Here is a block tag ins:
+
+
+Some text
+
+
+And here it is inside a paragraph.
+
+And here it is in the middle of a paragraph.
+
+
+Some text
+
+
+And here is ins as a paragraph.
+
+And here it is in the middle of a paragraph.
diff --git a/test/resources/php-markdown.mdtest/Ins & del.xhtml b/test/resources/php-markdown.mdtest/Ins & del.xhtml
new file mode 100644
index 0000000..60e8c5f
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Ins & del.xhtml
@@ -0,0 +1,17 @@
+Here is a block tag ins:
+
+
+Some text
+
+
+And here it is inside a paragraph.
+
+And here it is in the middle of a paragraph.
+
+
+Some text
+
+
+And here is ins as a paragraph.
+
+And here it is in the middle of a paragraph.
diff --git a/test/resources/php-markdown.mdtest/Links, inline style.text b/test/resources/php-markdown.mdtest/Links, inline style.text
new file mode 100644
index 0000000..1c9195b
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Links, inline style.text
@@ -0,0 +1,9 @@
+[silly URL w/ angle brackets](}]*+|&)>).
+
+[link]( "title").
+
+[link][].
+
+[link]: "title"
+
+[link]()
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Links, inline style.xhtml b/test/resources/php-markdown.mdtest/Links, inline style.xhtml
new file mode 100644
index 0000000..bbc06fd
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Links, inline style.xhtml
@@ -0,0 +1,7 @@
+silly URL w/ angle brackets.
+
+link.
+
+link.
+
+link
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/MD5 Hashes.text b/test/resources/php-markdown.mdtest/MD5 Hashes.text
new file mode 100644
index 0000000..7e03221
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/MD5 Hashes.text
@@ -0,0 +1,11 @@
+# Character Escapes
+
+The MD5 value for `+` is "26b17225b626fb9238849fd60eabdf60".
+
+# HTML Blocks
+
+test
+
+The MD5 value for `test
` is:
+
+6205333b793f34273d75379350b36826
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/MD5 Hashes.xhtml b/test/resources/php-markdown.mdtest/MD5 Hashes.xhtml
new file mode 100644
index 0000000..894e4aa
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/MD5 Hashes.xhtml
@@ -0,0 +1,11 @@
+Character Escapes
+
+The MD5 value for + is "26b17225b626fb9238849fd60eabdf60".
+
+HTML Blocks
+
+test
+
+The MD5 value for <p>test</p> is:
+
+6205333b793f34273d75379350b36826
diff --git a/test/resources/php-markdown.mdtest/Mixed OLs and ULs.text b/test/resources/php-markdown.mdtest/Mixed OLs and ULs.text
new file mode 100644
index 0000000..cecde21
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Mixed OLs and ULs.text
@@ -0,0 +1,13 @@
+* test
++ test
+- test
+
+1. test
+2. test
+
+* test
++ test
+- test
+
+1. test
+2. test
diff --git a/test/resources/php-markdown.mdtest/Mixed OLs and ULs.xhtml b/test/resources/php-markdown.mdtest/Mixed OLs and ULs.xhtml
new file mode 100644
index 0000000..0872aaa
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Mixed OLs and ULs.xhtml
@@ -0,0 +1,21 @@
+
+
+
+- test
+- test
+
+
+
+
+
+- test
+- test
+
diff --git a/test/resources/php-markdown.mdtest/Nesting.text b/test/resources/php-markdown.mdtest/Nesting.text
new file mode 100644
index 0000000..791538c
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Nesting.text
@@ -0,0 +1,11 @@
+Valid nesting:
+
+**[Link](url)**
+
+[**Link**](url)
+
+**[**Link**](url)**
+
+Invalid nesting:
+
+[[Link](url)](url)
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Nesting.xhtml b/test/resources/php-markdown.mdtest/Nesting.xhtml
new file mode 100644
index 0000000..37845d3
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Nesting.xhtml
@@ -0,0 +1,11 @@
+Valid nesting:
+
+Link
+
+Link
+
+Link
+
+Invalid nesting:
+
+[Link](url)
diff --git a/test/resources/php-markdown.mdtest/PHP-Specific Bugs.text b/test/resources/php-markdown.mdtest/PHP-Specific Bugs.text
new file mode 100644
index 0000000..246b60d
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/PHP-Specific Bugs.text
@@ -0,0 +1,22 @@
+This tests for a bug where quotes escaped by PHP when using
+`preg_replace` with the `/e` modifier must be correctly unescaped
+(hence the `_UnslashQuotes` function found only in PHP Markdown).
+
+
+
+Headers below should appear exactly as they are typed (no backslash
+added or removed).
+
+Header "quoted\" again \\""
+===========================
+
+Header "quoted\" again \\""
+---------------------------
+
+### Header "quoted\" again \\"" ###
+
+
+
+Test with tabs for `_Detab`:
+
+ Code 'block' with some "tabs" and "quotes"
diff --git a/test/resources/php-markdown.mdtest/PHP-Specific Bugs.xhtml b/test/resources/php-markdown.mdtest/PHP-Specific Bugs.xhtml
new file mode 100644
index 0000000..c982417
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/PHP-Specific Bugs.xhtml
@@ -0,0 +1,17 @@
+This tests for a bug where quotes escaped by PHP when using
+preg_replace with the /e modifier must be correctly unescaped
+(hence the _UnslashQuotes function found only in PHP Markdown).
+
+Headers below should appear exactly as they are typed (no backslash
+added or removed).
+
+Header "quoted\" again \""
+
+Header "quoted\" again \""
+
+Header "quoted\" again \""
+
+Test with tabs for _Detab:
+
+Code 'block' with some "tabs" and "quotes"
+
diff --git a/test/resources/php-markdown.mdtest/Parens in URL.text b/test/resources/php-markdown.mdtest/Parens in URL.text
new file mode 100644
index 0000000..bb7be4f
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Parens in URL.text
@@ -0,0 +1,14 @@
+[Inline link 1 with parens](/url\(test\) "title").
+
+[Inline link 2 with parens]( "title").
+
+[Inline link 3 with non-escaped parens](/url(test) "title").
+
+[Inline link 4 with non-escaped parens]( "title").
+
+[Reference link 1 with parens][1].
+
+[Reference link 2 with parens][2].
+
+ [1]: /url(test) "title"
+ [2]: "title"
diff --git a/test/resources/php-markdown.mdtest/Parens in URL.xhtml b/test/resources/php-markdown.mdtest/Parens in URL.xhtml
new file mode 100644
index 0000000..a81aa02
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Parens in URL.xhtml
@@ -0,0 +1,11 @@
+Inline link 1 with parens.
+
+Inline link 2 with parens.
+
+Inline link 3 with non-escaped parens.
+
+Inline link 4 with non-escaped parens.
+
+Reference link 1 with parens.
+
+Reference link 2 with parens.
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Quotes in attributes.text b/test/resources/php-markdown.mdtest/Quotes in attributes.text
new file mode 100644
index 0000000..9792286
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Quotes in attributes.text
@@ -0,0 +1,5 @@
+[Test](/"style="color:red)
+[Test](/'style='color:red)
+
+
+
diff --git a/test/resources/php-markdown.mdtest/Quotes in attributes.xhtml b/test/resources/php-markdown.mdtest/Quotes in attributes.xhtml
new file mode 100644
index 0000000..e3fcfd2
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Quotes in attributes.xhtml
@@ -0,0 +1,5 @@
+Test
+Test
+
+
+
diff --git a/test/resources/php-markdown.mdtest/Tight blocks.text b/test/resources/php-markdown.mdtest/Tight blocks.text
new file mode 100644
index 0000000..ae4cdcb
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Tight blocks.text
@@ -0,0 +1 @@
+Paragraph and no space:
* ciao
Paragraph and 1 space:
* ciao
Paragraph and 3 spaces:
* ciao
Paragraph and 4 spaces:
* ciao
Paragraph before header:
#Header
Paragraph before blockquote:
>Some quote.
\ No newline at end of file
diff --git a/test/resources/php-markdown.mdtest/Tight blocks.xhtml b/test/resources/php-markdown.mdtest/Tight blocks.xhtml
new file mode 100644
index 0000000..8655430
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/Tight blocks.xhtml
@@ -0,0 +1,21 @@
+Paragraph and no space:
+* ciao
+
+Paragraph and 1 space:
+ * ciao
+
+Paragraph and 3 spaces:
+ * ciao
+
+Paragraph and 4 spaces:
+ * ciao
+
+Paragraph before header:
+
+Header
+
+Paragraph before blockquote:
+
+
+ Some quote.
+
diff --git a/test/resources/php-markdown.mdtest/XML empty tag.text b/test/resources/php-markdown.mdtest/XML empty tag.text
new file mode 100644
index 0000000..97714ab
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/XML empty tag.text
@@ -0,0 +1,2 @@
+First line.
+Second line.
diff --git a/test/resources/php-markdown.mdtest/XML empty tag.xhtml b/test/resources/php-markdown.mdtest/XML empty tag.xhtml
new file mode 100644
index 0000000..f5d472b
--- /dev/null
+++ b/test/resources/php-markdown.mdtest/XML empty tag.xhtml
@@ -0,0 +1,2 @@
+First line.
+Second line.
\ No newline at end of file