From 2382acb9f10bec86c227fbd576a682d593053802 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Foo Foo Foo Foo
Making code
work for you
Making `code`
work for you
Making code
work for you
This thing
should be two
spans.
I should think that the
-tar
command would be universal.
The left angle-bracket (<
) can also be written as a decimal-encoded
-(<
) or hex-encoded (<
) entity.
world
views
This is a chunk of code:
- -some.code > some.other_code
-
-
-Some stuff.
->>> - -# Para plus code block (literal tab, no colon) -<<< -This is a chunk of code - - some.code > some.other_code - -Some stuff. ---- Should become: -This is a chunk of code
- -some.code > some.other_code
-
-
-Some stuff.
->>> - -# Para plus code block (tab-width spaces) -<<< -This is a chunk of code: - - some.code > some.other_code - -Some stuff. ---- Should become: -This is a chunk of code:
- -some.code > some.other_code
-
-
-Some stuff.
->>> - -# Para plus code block (tab-width spaces, no colon) -<<< -This is a chunk of code - - some.code > some.other_code - -Some stuff. ---- Should become: -This is a chunk of code
- -some.code > some.other_code
-
-
-Some stuff.
->>> - -# Colon with preceeding space -<<< -A regular paragraph, without a colon. : - - This is a code block. - -Some stuff. ---- Should become: -A regular paragraph, without a colon. :
- -This is a code block.
-
-
-Some stuff.
->>> - -# Single colon -<<< -: - - some.code > some.other_code - -Some stuff. ---- Should become: -:
- -some.code > some.other_code
-
-
-Some stuff.
->>> - -# Preserve leading whitespace (Bug #541) -<<< -Examples: - - # (Waste character because first line is flush left !!!) - # Example script1 - x = 1 - x += 1 - puts x - -Some stuff. ---- Should become: -Examples:
- - # (Waste character because first line is flush left !!!)
- # Example script1
- x = 1
- x += 1
- puts x
-
-
-Some stuff.
->>> - - ### [Horizontal Rules] # Hrule 1 @@ -484,203 +303,6 @@ Some stuff. >>> -### [Titles] - -# setext-style h1 -<<< -Title Text -= ---- Should become: -Use single splats for emphasis.
->>> - -# Emphasis () with underscores -<<< -Use *underscores* for emphasis. ---- Should become: -Use underscores for emphasis.
->>> - -# Strong emphasis () with asterisks -<<< -Use **double splats** for more emphasis. ---- Should become: -Use double splats for more emphasis.
->>> - -# Strong emphasis () with underscores -<<< -Use __doubled underscores__ for more emphasis. ---- Should become: -Use doubled underscores for more emphasis.
->>> - -# Combined emphasis types 1 -<<< -Use *single splats* or _single unders_ for normal emphasis. ---- Should become: -Use single splats or single unders for normal emphasis.
->>> - -# Combined emphasis types 2 -<<< -Use _single unders_ for normal emphasis -or __double them__ for strong emphasis. ---- Should become: -Use single unders for normal emphasis -or double them for strong emphasis.
->>> - -# Emphasis containing escaped metachars -<<< -You can include literal *\*splats\** by escaping them. ---- Should become: -You can include literal *splats* by escaping them.
->>> - -# Two instances of asterisked emphasis on one line -<<< -If there's *two* splatted parts on a *single line* it should still work. ---- Should become: -If there's two splatted parts on a single line it should still work.
->>> - -# Two instances of double asterisked emphasis on one line -<<< -This **doubled** one should **work too**. ---- Should become: -This doubled one should work too.
->>> - -# Two instances of underscore emphasis on one line -<<< -If there's _two_ underbarred parts on a _single line_ it should still work. ---- Should become: -If there's two underbarred parts on a single line it should still work.
->>> - -# Two instances of doubled underscore emphasis on one line -<<< -This __doubled__ one should __work too__. ---- Should become: -This doubled one should work too.
->>> - -# Initial emphasis (asterisk) -<<< -*Something* like this should be bold. ---- Should become: -Something like this should be bold.
->>> - -# Initial emphasis (underscore) -<<< -_Something_ like this should be bold. ---- Should become: -Something like this should be bold.
->>> - -# Initial strong emphasis (asterisk) -<<< -**Something** like this should be bold. ---- Should become: -Something like this should be bold.
->>> - -# Initial strong emphasis (underscore) -<<< -__Something__ like this should be bold. ---- Should become: -Something like this should be bold.
->>> - -# Partial-word emphasis (Bug #568) -<<< -**E**xtended **TURN** ---- Should become: -Extended TURN
->>> - - - -### [Links] - -# Inline link, no title -<<< -An [example](http://url.com/). ---- Should become: -An example.
->>> - -# Inline link with title -<<< -An [example](http://url.com/ "Check out url.com!"). ---- Should become: -An example.
->>> - -# Reference-style link, no title -<<< -An [example][ex] reference-style link. - -[ex]: http://www.bluefi.com/ ---- Should become: -An example reference-style link.
->>> - -# Indented (less than tabwidth) reference-style link -<<< -An [example][ex] reference-style link. - - [ex]: http://www.bluefi.com/ ---- Should become: -An example reference-style link.
->>> - -# Reference-style link with quoted title -<<< -An [example][ex] reference-style link. - -[ex]: http://www.bluefi.com/ "Check out our air." ---- Should become: -An example reference-style link.
->>> - -# Reference-style link with paren title -<<< -An [example][ex] reference-style link. - -[ex]: http://www.bluefi.com/ (Check out our air.) ---- Should become: -An example reference-style link.
->>> - -# Reference-style link with one of each (hehe) -<<< -An [example][ex] reference-style link. - -[ex]: http://www.bluefi.com/ "Check out our air.) ---- Should become: -An example reference-style link.
->>> - -" <- For syntax highlighting - -# Reference-style link with intervening space -<<< -You can split the [linked part] [ex] from -the reference part with a single space. - -[ex]: http://www.treefrog.com/ "for some reason" ---- Should become: -You can split the linked part from -the reference part with a single space.
->>> - -# Reference-style link with intervening space -<<< -You can split the [linked part] - [ex] from the reference part -with a newline in case your editor wraps it there, I guess. - -[ex]: http://www.treefrog.com/ ---- Should become: -You can split the linked part from the reference part -with a newline in case your editor wraps it there, I guess.
->>> - -# Reference-style anchors -<<< -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" ---- Should become: -I get 10 times more traffic from Google than from -Yahoo or MSN.
->>> - -# Implicit name-link shortcut anchors -<<< -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" ---- Should become: -I get 10 times more traffic from Google than from -Yahoo or MSN.
->>> - -# Inline anchors -<<< -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"). ---- Should become: -I get 10 times more traffic from Google -than from Yahoo or -MSN.
->>> - -# Graceful fail for unclosed brackets (and bug #524) -<<< -This is just a [bracket opener; it should fail gracefully. ---- Should become: -This is just a [bracket opener; it should fail gracefully.
->>> - -# Unresolved reference-style links (Bug #620) -<<< -This is an unresolved [url][1]. ---- Should become: -This is an unresolved [url][1].
->>> - - -### [Auto-links] - -# Plain HTTP link -<<< -This is a reference toThis is a reference to http://www.FaerieMUD.org/. You should follow it.
->>> - -# FTP link -<<< -Why not download your very own chandelier fromWhy not download your very own chandelier from ftp://ftp.usuc.edu/pub/foof/mir/?
->>> - - -### [Lists] - -# Unordered list -<<< -* Red -* Green -* Blue ---- Should become: -Bird
Magic
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.
Suspendisse id sem consectetuer libero luctus adipiscing.
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.
Suspendisse id sem consectetuer libero luctus adipiscing.
This is a following paragraph which shouldn't be part of the list.
->>> - -# Lazy multi-paragraphs -<<< -* 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. ---- Should become: -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.
A list item with a blockquote:
- --This is a blockquote - inside a list item.
-
---- Should become:
-
-A list item with a code block:
-
-<code goes here>
-
-
->>>
-
-# Backslash-escaped number-period-space
-<<<
-1986\. What a great season.
---- Should become:
-1986. What a great season.
->>>
-
-
### [1.0.1 changes]
# Header + list + code
diff --git a/spec/samples/code b/spec/samples/code
new file mode 100644
index 0000000..812c010
--- /dev/null
+++ b/spec/samples/code
@@ -0,0 +1,177 @@
+### [Code spans]
+
+# Single backtick
+<<<
+Making `code` work for you
+--- Should become:
+Making code
work for you
+>>>
+
+# Literal backtick with doubling
+<<<
+Making `` `code` `` work for you
+--- Should become:
+Making `code`
work for you
+>>>
+
+# Many repetitions
+<<<
+Making `````code````` work for you
+--- Should become:
+Making code
work for you
+>>>
+
+# Two in a row
+<<<
+This `thing` should be `two` spans.
+--- Should become:
+This thing
should be two
spans.
+>>>
+
+# At the beginning of a newline
+<<<
+I should think that the
+`tar` command would be universal.
+--- Should become:
+I should think that the
+tar
command would be universal.
+>>>
+
+# Entity escaping
+<<<
+The left angle-bracket (`<`) can also be written as a decimal-encoded
+(`<`) or hex-encoded (`<`) entity.
+--- Should become:
+The left angle-bracket (<
) can also be written as a decimal-encoded
+(<
) or hex-encoded (<
) entity.
+>>>
+
+# At the beginning of a document (Bug #525)
+<<<
+`world` views
+--- Should become:
+world
views
+>>>
+
+
+### [Code blocks]
+
+# Para plus code block (literal tab)
+<<<
+This is a chunk of code:
+
+ some.code > some.other_code
+
+Some stuff.
+--- Should become:
+This is a chunk of code:
+
+some.code > some.other_code
+
+
+Some stuff.
+>>>
+
+# Para plus code block (literal tab, no colon)
+<<<
+This is a chunk of code
+
+ some.code > some.other_code
+
+Some stuff.
+--- Should become:
+This is a chunk of code
+
+some.code > some.other_code
+
+
+Some stuff.
+>>>
+
+# Para plus code block (tab-width spaces)
+<<<
+This is a chunk of code:
+
+ some.code > some.other_code
+
+Some stuff.
+--- Should become:
+This is a chunk of code:
+
+some.code > some.other_code
+
+
+Some stuff.
+>>>
+
+# Para plus code block (tab-width spaces, no colon)
+<<<
+This is a chunk of code
+
+ some.code > some.other_code
+
+Some stuff.
+--- Should become:
+This is a chunk of code
+
+some.code > some.other_code
+
+
+Some stuff.
+>>>
+
+# Colon with preceeding space
+<<<
+A regular paragraph, without a colon. :
+
+ This is a code block.
+
+Some stuff.
+--- Should become:
+A regular paragraph, without a colon. :
+
+This is a code block.
+
+
+Some stuff.
+>>>
+
+# Single colon
+<<<
+:
+
+ some.code > some.other_code
+
+Some stuff.
+--- Should become:
+:
+
+some.code > some.other_code
+
+
+Some stuff.
+>>>
+
+# Preserve leading whitespace (Bug #541)
+<<<
+Examples:
+
+ # (Waste character because first line is flush left !!!)
+ # Example script1
+ x = 1
+ x += 1
+ puts x
+
+Some stuff.
+--- Should become:
+Examples:
+
+ # (Waste character because first line is flush left !!!)
+ # Example script1
+ x = 1
+ x += 1
+ puts x
+
+
+Some stuff.
+>>>
diff --git a/spec/samples/emphasis b/spec/samples/emphasis
new file mode 100644
index 0000000..f9bc32d
--- /dev/null
+++ b/spec/samples/emphasis
@@ -0,0 +1,152 @@
+### [Emphasis]
+
+# Emphasis () with asterisks
+<<<
+Use *single splats* for emphasis.
+--- Should become:
+Use single splats for emphasis.
+>>>
+
+# Emphasis () with underscores
+<<<
+Use *underscores* for emphasis.
+--- Should become:
+Use underscores for emphasis.
+>>>
+
+# Strong emphasis () with asterisks
+<<<
+Use **double splats** for more emphasis.
+--- Should become:
+Use double splats for more emphasis.
+>>>
+
+# Strong emphasis () with underscores
+<<<
+Use __doubled underscores__ for more emphasis.
+--- Should become:
+Use doubled underscores for more emphasis.
+>>>
+
+# Combined emphasis types 1
+<<<
+Use *single splats* or _single unders_ for normal emphasis.
+--- Should become:
+Use single splats or single unders for normal emphasis.
+>>>
+
+# Combined emphasis types 2
+<<<
+Use _single unders_ for normal emphasis
+or __double them__ for strong emphasis.
+--- Should become:
+Use single unders for normal emphasis
+or double them for strong emphasis.
+>>>
+
+# Emphasis containing escaped metachars
+<<<
+You can include literal *\*splats\** by escaping them.
+--- Should become:
+You can include literal *splats* by escaping them.
+>>>
+
+# Two instances of asterisked emphasis on one line
+<<<
+If there's *two* splatted parts on a *single line* it should still work.
+--- Should become:
+If there's two splatted parts on a single line it should still work.
+>>>
+
+# Two instances of double asterisked emphasis on one line
+<<<
+This **doubled** one should **work too**.
+--- Should become:
+This doubled one should work too.
+>>>
+
+# Two instances of underscore emphasis on one line
+<<<
+If there's _two_ underbarred parts on a _single line_ it should still work.
+--- Should become:
+If there's two underbarred parts on a single line it should still work.
+>>>
+
+# Two instances of doubled underscore emphasis on one line
+<<<
+This __doubled__ one should __work too__.
+--- Should become:
+This doubled one should work too.
+>>>
+
+# Initial emphasis (asterisk)
+<<<
+*Something* like this should be bold.
+--- Should become:
+Something like this should be bold.
+>>>
+
+# Initial emphasis (underscore)
+<<<
+_Something_ like this should be bold.
+--- Should become:
+Something like this should be bold.
+>>>
+
+# Initial strong emphasis (asterisk)
+<<<
+**Something** like this should be bold.
+--- Should become:
+Something like this should be bold.
+>>>
+
+# Initial strong emphasis (underscore)
+<<<
+__Something__ like this should be bold.
+--- Should become:
+Something like this should be bold.
+>>>
+
+# Partial-word emphasis (Bug #568)
+<<<
+**E**xtended **TURN**
+--- Should become:
+Extended TURN
+>>>
+
+# Double underscores in words shouldn't create emphasis
+<<<
+assert__no__emphasis
+--- Should become:
+assert__no__emphasis
+>>>
+
+# Asterisks in words should create emphasis
+<<<
+we**have**emphasis and we*like*it
+--- Should become:
+wehaveemphasis and welikeit
+>>>
+
+# Ruby methods don't create emphasis
+<<<
+Here I am mentioning will_paginate and paginated_each methods.
+People seem to like acts_as_ferret for indexing.
+--- Should become:
+Here I am mentioning will_paginate and paginated_each methods.
+People seem to like acts_as_ferret for indexing.
+>>>
+
+# Ruby methods in CODE spans don't create emphasis
+<<<
+Here I am mentioning `will_paginate` and `paginated_each` methods.
+--- Should become:
+Here I am mentioning will_paginate
and paginated_each
methods.
+>>>
+
+# should be able to emphasise a Ruby method with underscores
+<<<
+_acts_as_ferret_
+--- Should become:
+acts_as_ferret
+>>>
diff --git a/spec/samples/links b/spec/samples/links
new file mode 100644
index 0000000..a54c4a1
--- /dev/null
+++ b/spec/samples/links
@@ -0,0 +1,153 @@
+### [Links]
+
+# Inline link, no title
+<<<
+An [example](http://url.com/).
+--- Should become:
+An example.
+>>>
+
+# Inline link with title
+<<<
+An [example](http://url.com/ "Check out url.com!").
+--- Should become:
+An example.
+>>>
+
+# Reference-style link, no title
+<<<
+An [example][ex] reference-style link.
+
+[ex]: http://www.bluefi.com/
+--- Should become:
+An example reference-style link.
+>>>
+
+# Indented (less than tabwidth) reference-style link
+<<<
+An [example][ex] reference-style link.
+
+ [ex]: http://www.bluefi.com/
+--- Should become:
+An example reference-style link.
+>>>
+
+# Reference-style link with quoted title
+<<<
+An [example][ex] reference-style link.
+
+[ex]: http://www.bluefi.com/ "Check out our air."
+--- Should become:
+An example reference-style link.
+>>>
+
+# Reference-style link with paren title
+<<<
+An [example][ex] reference-style link.
+
+[ex]: http://www.bluefi.com/ (Check out our air.)
+--- Should become:
+An example reference-style link.
+>>>
+
+# Reference-style link with one of each (hehe)
+<<<
+An [example][ex] reference-style link.
+
+[ex]: http://www.bluefi.com/ "Check out our air.)
+--- Should become:
+An example reference-style link.
+>>>
+
+" <- For syntax highlighting
+
+# Reference-style link with intervening space
+<<<
+You can split the [linked part] [ex] from
+the reference part with a single space.
+
+[ex]: http://www.treefrog.com/ "for some reason"
+--- Should become:
+You can split the linked part from
+the reference part with a single space.
+>>>
+
+# Reference-style link with intervening space
+<<<
+You can split the [linked part]
+ [ex] from the reference part
+with a newline in case your editor wraps it there, I guess.
+
+[ex]: http://www.treefrog.com/
+--- Should become:
+You can split the linked part from the reference part
+with a newline in case your editor wraps it there, I guess.
+>>>
+
+# Reference-style anchors
+<<<
+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"
+--- Should become:
+I get 10 times more traffic from Google than from
+Yahoo or MSN.
+>>>
+
+# Implicit name-link shortcut anchors
+<<<
+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"
+--- Should become:
+I get 10 times more traffic from Google than from
+Yahoo or MSN.
+>>>
+
+# Inline anchors
+<<<
+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").
+--- Should become:
+I get 10 times more traffic from Google
+than from Yahoo or
+MSN.
+>>>
+
+# Graceful fail for unclosed brackets (and bug #524)
+<<<
+This is just a [bracket opener; it should fail gracefully.
+--- Should become:
+This is just a [bracket opener; it should fail gracefully.
+>>>
+
+# Unresolved reference-style links (Bug #620)
+<<<
+This is an unresolved [url][1].
+--- Should become:
+This is an unresolved [url][1].
+>>>
+
+
+### [Auto-links]
+
+# Plain HTTP link
+<<<
+This is a reference to . You should follow it.
+--- Should become:
+This is a reference to http://www.FaerieMUD.org/. You should follow it.
+>>>
+
+# FTP link
+<<<
+Why not download your very own chandelier from ?
+--- Should become:
+Why not download your very own chandelier from ftp://ftp.usuc.edu/pub/foof/mir/?
+>>>
diff --git a/spec/samples/lists b/spec/samples/lists
new file mode 100644
index 0000000..af59986
--- /dev/null
+++ b/spec/samples/lists
@@ -0,0 +1,248 @@
+### [Lists]
+
+# Unordered list
+<<<
+* Red
+* Green
+* Blue
+--- Should become:
+
+- Red
+- Green
+- Blue
+
+>>>
+
+# Unordered list w/alt bullets
+<<<
+- Red
+- Green
+- Blue
+--- Should become:
+
+- Red
+- Green
+- Blue
+
+>>>
+
+# Unordered list w/alt bullets 2
+<<<
++ Red
++ Green
++ Blue
+--- Should become:
+
+- Red
+- Green
+- Blue
+
+>>>
+
+# Unordered list w/mixed bullets
+<<<
++ Red
+- Green
+* Blue
+--- Should become:
+
+- Red
+- Green
+- Blue
+
+>>>
+
+# Ordered list
+<<<
+1. Bird
+2. McHale
+3. Parish
+--- Should become:
+
+- Bird
+- McHale
+- Parish
+
+>>>
+
+# Ordered list, any numbers
+<<<
+1. Bird
+1. McHale
+1. Parish
+--- Should become:
+
+- Bird
+- McHale
+- Parish
+
+>>>
+
+# Ordered list, any numbers 2
+<<<
+3. Bird
+1. McHale
+8. Parish
+--- Should become:
+
+- Bird
+- McHale
+- Parish
+
+>>>
+
+# 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.
+--- Should become:
+
+- 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.
+
+>>>
+
+# Lazy 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.
+--- Should become:
+
+- 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.
+
+>>>
+
+# Paragraph wrapped list items
+<<<
+* Bird
+
+* Magic
+--- Should become:
+
+Bird
+Magic
+
+>>>
+
+# Multi-paragraph list items
+<<<
+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.
+--- Should become:
+
+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.
+Suspendisse id sem consectetuer libero luctus adipiscing.
+
+>>>
+
+# Multi-paragraph list items followed by paragraph
+<<<
+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.
+
+This is a following paragraph which shouldn't be part of the list.
+--- Should become:
+
+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.
+Suspendisse id sem consectetuer libero luctus adipiscing.
+
+
+This is a following paragraph which shouldn't be part of the list.
+>>>
+
+# Lazy multi-paragraphs
+<<<
+* 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.
+--- Should become:
+
+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.
+
+>>>
+
+# Blockquote in list item
+<<<
+* A list item with a blockquote:
+
+ > This is a blockquote
+ > inside a list item.
+--- Should become:
+
+A list item with a blockquote:
+
+
+ This is a blockquote
+ inside a list item.
+
+
+>>>
+
+# Code block in list item
+<<<
+* A list item with a code block:
+
+
+--- Should become:
+
+A list item with a code block:
+
+<code goes here>
+
+
+>>>
+
+# Backslash-escaped number-period-space
+<<<
+1986\. What a great season.
+--- Should become:
+1986. What a great season.
+>>>
diff --git a/spec/samples/titles b/spec/samples/titles
new file mode 100644
index 0000000..544eef9
--- /dev/null
+++ b/spec/samples/titles
@@ -0,0 +1,240 @@
+### [Titles]
+
+# setext-style h1
+<<<
+Title Text
+=
+--- Should become:
+Title Text
+>>>
+
+<<<
+Title Text
+===
+--- Should become:
+Title Text
+>>>
+
+<<<
+Title Text
+==========
+--- Should become:
+Title Text
+>>>
+
+# setext-style h2
+<<<
+Title Text
+-
+--- Should become:
+Title Text
+>>>
+
+<<<
+Title Text
+---
+--- Should become:
+Title Text
+>>>
+
+<<<
+Title Text
+----------
+--- Should become:
+Title Text
+>>>
+
+# ATX-style h1
+<<<
+# Title Text
+--- Should become:
+Title Text
+>>>
+
+<<<
+# Title Text #
+--- Should become:
+Title Text
+>>>
+
+<<<
+# Title Text ###
+--- Should become:
+Title Text
+>>>
+
+<<<
+# Title Text #####
+--- Should become:
+Title Text
+>>>
+
+# ATX-style h2
+<<<
+## Title Text
+--- Should become:
+Title Text
+>>>
+
+<<<
+## Title Text #
+--- Should become:
+Title Text
+>>>
+
+<<<
+## Title Text ###
+--- Should become:
+Title Text
+>>>
+
+<<<
+## Title Text #####
+--- Should become:
+Title Text
+>>>
+
+# ATX-style h3
+<<<
+### Title Text
+--- Should become:
+Title Text
+>>>
+
+<<<
+### Title Text #
+--- Should become:
+Title Text
+>>>
+
+<<<
+### Title Text ###
+--- Should become:
+Title Text
+>>>
+
+<<<
+### Title Text #####
+--- Should become:
+Title Text
+>>>
+
+# ATX-style h4
+<<<
+#### Title Text
+--- Should become:
+Title Text
+>>>
+
+<<<
+#### Title Text #
+--- Should become:
+Title Text
+>>>
+
+<<<
+#### Title Text ###
+--- Should become:
+Title Text
+>>>
+
+<<<
+#### Title Text #####
+--- Should become:
+Title Text
+>>>
+
+# ATX-style h5
+<<<
+##### Title Text
+--- Should become:
+Title Text
+>>>
+
+<<<
+##### Title Text #
+--- Should become:
+Title Text
+>>>
+
+<<<
+##### Title Text ###
+--- Should become:
+Title Text
+>>>
+
+<<<
+##### Title Text #####
+--- Should become:
+Title Text
+>>>
+
+# ATX-style h6
+<<<
+###### Title Text
+--- Should become:
+Title Text
+>>>
+
+<<<
+###### Title Text #
+--- Should become:
+Title Text
+>>>
+
+<<<
+###### Title Text ###
+--- Should become:
+Title Text
+>>>
+
+<<<
+###### Title Text #####
+--- Should become:
+Title Text
+>>>
+
+# mixed-style headings
+<<<
+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
+--- becomes:
+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
+
+>>>