bluecloth 2.0.6.pre120-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. data/ChangeLog +363 -0
  2. data/LICENSE +27 -0
  3. data/LICENSE.discount +47 -0
  4. data/README +81 -0
  5. data/Rakefile +349 -0
  6. data/Rakefile.local +43 -0
  7. data/bin/bluecloth +84 -0
  8. data/ext/Csio.c +61 -0
  9. data/ext/VERSION +1 -0
  10. data/ext/amalloc.h +29 -0
  11. data/ext/bluecloth.c +391 -0
  12. data/ext/bluecloth.h +19 -0
  13. data/ext/config.h +55 -0
  14. data/ext/css.c +76 -0
  15. data/ext/cstring.h +75 -0
  16. data/ext/docheader.c +43 -0
  17. data/ext/extconf.rb +52 -0
  18. data/ext/generate.c +1602 -0
  19. data/ext/markdown.c +1078 -0
  20. data/ext/markdown.h +146 -0
  21. data/ext/mkdio.c +303 -0
  22. data/ext/mkdio.h +79 -0
  23. data/ext/resource.c +155 -0
  24. data/ext/version.c +28 -0
  25. data/ext/xml.c +82 -0
  26. data/ext/xmlpage.c +48 -0
  27. data/lib/1.8/bluecloth_ext.so +0 -0
  28. data/lib/1.9/bluecloth_ext.so +0 -0
  29. data/lib/bluecloth.rb +164 -0
  30. data/rake/191_compat.rb +26 -0
  31. data/rake/dependencies.rb +76 -0
  32. data/rake/helpers.rb +434 -0
  33. data/rake/hg.rb +273 -0
  34. data/rake/manual.rb +782 -0
  35. data/rake/packaging.rb +126 -0
  36. data/rake/publishing.rb +269 -0
  37. data/rake/rdoc.rb +30 -0
  38. data/rake/style.rb +62 -0
  39. data/rake/svn.rb +668 -0
  40. data/rake/testing.rb +187 -0
  41. data/rake/verifytask.rb +64 -0
  42. data/rake/win32.rb +190 -0
  43. data/spec/bluecloth/101_changes_spec.rb +141 -0
  44. data/spec/bluecloth/autolinks_spec.rb +49 -0
  45. data/spec/bluecloth/blockquotes_spec.rb +145 -0
  46. data/spec/bluecloth/code_spans_spec.rb +164 -0
  47. data/spec/bluecloth/emphasis_spec.rb +164 -0
  48. data/spec/bluecloth/entities_spec.rb +65 -0
  49. data/spec/bluecloth/hrules_spec.rb +90 -0
  50. data/spec/bluecloth/images_spec.rb +92 -0
  51. data/spec/bluecloth/inline_html_spec.rb +238 -0
  52. data/spec/bluecloth/links_spec.rb +171 -0
  53. data/spec/bluecloth/lists_spec.rb +294 -0
  54. data/spec/bluecloth/paragraphs_spec.rb +75 -0
  55. data/spec/bluecloth/titles_spec.rb +305 -0
  56. data/spec/bluecloth_spec.rb +281 -0
  57. data/spec/bugfix_spec.rb +172 -0
  58. data/spec/contributions_spec.rb +85 -0
  59. data/spec/data/antsugar.txt +34 -0
  60. data/spec/data/markdowntest/Amps and angle encoding.html +17 -0
  61. data/spec/data/markdowntest/Amps and angle encoding.text +21 -0
  62. data/spec/data/markdowntest/Auto links.html +18 -0
  63. data/spec/data/markdowntest/Auto links.text +13 -0
  64. data/spec/data/markdowntest/Backslash escapes.html +118 -0
  65. data/spec/data/markdowntest/Backslash escapes.text +120 -0
  66. data/spec/data/markdowntest/Blockquotes with code blocks.html +15 -0
  67. data/spec/data/markdowntest/Blockquotes with code blocks.text +11 -0
  68. data/spec/data/markdowntest/Code Blocks.html +18 -0
  69. data/spec/data/markdowntest/Code Blocks.text +14 -0
  70. data/spec/data/markdowntest/Code Spans.html +5 -0
  71. data/spec/data/markdowntest/Code Spans.text +5 -0
  72. data/spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.html +8 -0
  73. data/spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.text +8 -0
  74. data/spec/data/markdowntest/Horizontal rules.html +71 -0
  75. data/spec/data/markdowntest/Horizontal rules.text +67 -0
  76. data/spec/data/markdowntest/Inline HTML (Advanced).html +15 -0
  77. data/spec/data/markdowntest/Inline HTML (Advanced).text +15 -0
  78. data/spec/data/markdowntest/Inline HTML (Simple).html +72 -0
  79. data/spec/data/markdowntest/Inline HTML (Simple).text +69 -0
  80. data/spec/data/markdowntest/Inline HTML comments.html +13 -0
  81. data/spec/data/markdowntest/Inline HTML comments.text +13 -0
  82. data/spec/data/markdowntest/Links, inline style.html +11 -0
  83. data/spec/data/markdowntest/Links, inline style.text +12 -0
  84. data/spec/data/markdowntest/Links, reference style.html +52 -0
  85. data/spec/data/markdowntest/Links, reference style.text +71 -0
  86. data/spec/data/markdowntest/Links, shortcut references.html +9 -0
  87. data/spec/data/markdowntest/Links, shortcut references.text +20 -0
  88. data/spec/data/markdowntest/Literal quotes in titles.html +3 -0
  89. data/spec/data/markdowntest/Literal quotes in titles.text +7 -0
  90. data/spec/data/markdowntest/Markdown Documentation - Basics.html +314 -0
  91. data/spec/data/markdowntest/Markdown Documentation - Basics.text +306 -0
  92. data/spec/data/markdowntest/Markdown Documentation - Syntax.html +942 -0
  93. data/spec/data/markdowntest/Markdown Documentation - Syntax.text +888 -0
  94. data/spec/data/markdowntest/Nested blockquotes.html +9 -0
  95. data/spec/data/markdowntest/Nested blockquotes.text +5 -0
  96. data/spec/data/markdowntest/Ordered and unordered lists.html +148 -0
  97. data/spec/data/markdowntest/Ordered and unordered lists.text +131 -0
  98. data/spec/data/markdowntest/Strong and em together.html +7 -0
  99. data/spec/data/markdowntest/Strong and em together.text +7 -0
  100. data/spec/data/markdowntest/Tabs.html +25 -0
  101. data/spec/data/markdowntest/Tabs.text +21 -0
  102. data/spec/data/markdowntest/Tidyness.html +8 -0
  103. data/spec/data/markdowntest/Tidyness.text +5 -0
  104. data/spec/data/ml-announce.txt +17 -0
  105. data/spec/data/re-overflow.txt +67 -0
  106. data/spec/data/re-overflow2.txt +281 -0
  107. data/spec/discount_spec.rb +184 -0
  108. data/spec/lib/constants.rb +5 -0
  109. data/spec/lib/helpers.rb +137 -0
  110. data/spec/lib/matchers.rb +235 -0
  111. data/spec/markdowntest_spec.rb +79 -0
  112. metadata +205 -0
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ BEGIN {
5
+ require 'pathname'
6
+ basedir = Pathname.new( __FILE__ ).dirname.parent.parent
7
+
8
+ libdir = basedir + 'lib'
9
+ extdir = basedir + 'ext'
10
+
11
+ $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
+ $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
+ }
14
+
15
+ require 'spec'
16
+ require 'bluecloth'
17
+
18
+ require 'spec/lib/helpers'
19
+ require 'spec/lib/constants'
20
+ require 'spec/lib/matchers'
21
+
22
+
23
+ #####################################################################
24
+ ### C O N T E X T S
25
+ #####################################################################
26
+
27
+ describe BlueCloth, "auto-links" do
28
+ include BlueCloth::TestConstants,
29
+ BlueCloth::Matchers
30
+
31
+ it "supports HTTP auto-links" do
32
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
33
+ This is a reference to <http://www.FaerieMUD.org/>. You should follow it.
34
+ ---
35
+ <p>This is a reference to <a href="http://www.FaerieMUD.org/">http://www.FaerieMUD.org/</a>. You should follow it.</p>
36
+ ---
37
+ end
38
+
39
+ it "supports FTP auto-link" do
40
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
41
+ Why not download your very own chandelier from <ftp://ftp.usuc.edu/pub/foof/mir/>?
42
+ ---
43
+ <p>Why not download your very own chandelier from <a href="ftp://ftp.usuc.edu/pub/foof/mir/">ftp://ftp.usuc.edu/pub/foof/mir/</a>?</p>
44
+ ---
45
+ end
46
+
47
+ end
48
+
49
+
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ BEGIN {
5
+ require 'pathname'
6
+ basedir = Pathname.new( __FILE__ ).dirname.parent.parent
7
+
8
+ libdir = basedir + 'lib'
9
+ extdir = basedir + 'ext'
10
+
11
+ $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
+ $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
+ }
14
+
15
+ require 'spec'
16
+ require 'bluecloth'
17
+
18
+ require 'spec/lib/helpers'
19
+ require 'spec/lib/constants'
20
+ require 'spec/lib/matchers'
21
+
22
+
23
+ #####################################################################
24
+ ### C O N T E X T S
25
+ #####################################################################
26
+
27
+ describe BlueCloth, "blockquotes" do
28
+ include BlueCloth::TestConstants,
29
+ BlueCloth::Matchers
30
+
31
+ ### [Blockquotes]
32
+
33
+ # Regular 1-level blockquotes
34
+ it "wraps sections with an angle-bracket left margin in a blockquote" do
35
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
36
+ > Email-style angle brackets
37
+ > are used for blockquotes.
38
+ ---
39
+ <blockquote><p>Email-style angle brackets
40
+ are used for blockquotes.</p></blockquote>
41
+ ---
42
+ end
43
+
44
+ # Nested blockquotes
45
+ it "supports nested blockquote sections" do
46
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
47
+ > Email-style angle brackets
48
+ > are used for blockquotes.
49
+
50
+ > > And, they can be nested.
51
+ ---
52
+ <blockquote><p>Email-style angle brackets
53
+ are used for blockquotes.</p>
54
+
55
+ <blockquote><p>And, they can be nested.</p></blockquote></blockquote>
56
+ ---
57
+ end
58
+
59
+ # Doubled blockquotes
60
+ it "supports nested blockquote sections even if there's only one multi-level section" do
61
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
62
+ > > And, they can be nested.
63
+ ---
64
+ <blockquote><blockquote><p>And, they can be nested.</p></blockquote></blockquote>
65
+ ---
66
+ end
67
+
68
+ # Lazy blockquotes
69
+ it "wraps sections preceded by an angle-bracket in a blockquote" do
70
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
71
+ > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
72
+ consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
73
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
74
+
75
+ > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
76
+ id sem consectetuer libero luctus adipiscing.
77
+ ---
78
+ <blockquote><p>This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
79
+ consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
80
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.</p>
81
+
82
+ <p>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
83
+ id sem consectetuer libero luctus adipiscing.</p></blockquote>
84
+ ---
85
+ end
86
+
87
+
88
+ # Blockquotes containing other markdown elements
89
+ it "supports other Markdown elements in blockquote sections" do
90
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
91
+ > ## This is a header.
92
+ >
93
+ > 1. This is the first list item.
94
+ > 2. This is the second list item.
95
+ >
96
+ > Here's some example code:
97
+ >
98
+ > return shell_exec("echo $input | $markdown_script");
99
+ ---
100
+ <blockquote><h2>This is a header.</h2>
101
+
102
+ <ol>
103
+ <li>This is the first list item.</li>
104
+ <li>This is the second list item.</li>
105
+ </ol>
106
+
107
+ <p>Here's some example code:</p>
108
+
109
+ <pre><code>return shell_exec("echo $input | $markdown_script");
110
+ </code></pre></blockquote>
111
+ ---
112
+ end
113
+
114
+ # Blockquotes with a <pre> section
115
+ it "supports block-level HTML inside of blockquotes" do
116
+ pending "a fix in Discount" do
117
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
118
+ > The best approximation of the problem is the following code:
119
+ >
120
+ > <pre>
121
+ > foo + bar; foo.factorize; foo.display
122
+ > </pre>
123
+ >
124
+ > This should result in an error on any little-endian platform.
125
+ >
126
+ > <div>- Garrick Mettronne</div>
127
+ ---
128
+ <blockquote><p>The best approximation of the problem is the following code:</p>
129
+
130
+ <pre>
131
+ foo + bar; foo.factorize; foo.display
132
+ </pre>
133
+
134
+ <p>This should result in an error on any little-endian platform.</p>
135
+
136
+ <div>- Garrick Mettronne</div>
137
+ </blockquote>
138
+ ---
139
+ end
140
+ end
141
+
142
+
143
+ end
144
+
145
+
@@ -0,0 +1,164 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ BEGIN {
5
+ require 'pathname'
6
+ basedir = Pathname.new( __FILE__ ).dirname.parent.parent
7
+
8
+ libdir = basedir + 'lib'
9
+ extdir = basedir + 'ext'
10
+
11
+ $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
+ $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
+ }
14
+
15
+ require 'spec'
16
+ require 'bluecloth'
17
+
18
+ require 'spec/lib/helpers'
19
+ require 'spec/lib/constants'
20
+ require 'spec/lib/matchers'
21
+
22
+
23
+ #####################################################################
24
+ ### C O N T E X T S
25
+ #####################################################################
26
+
27
+ describe BlueCloth, "that contains code blocks or spans" do
28
+ include BlueCloth::TestConstants,
29
+ BlueCloth::Matchers
30
+
31
+ it "wraps CODE tags around backticked spans" do
32
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
33
+ Making `code` work for you
34
+ ---
35
+ <p>Making <code>code</code> work for you</p>
36
+ ---
37
+ end
38
+
39
+ it "allows you to place literal backtick characters at the beginning or end of a code span " +
40
+ "by padding the inner string with spaces" do
41
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
42
+ Making `` `code` `` work for you
43
+ ---
44
+ <p>Making <code>`code`</code> work for you</p>
45
+ ---
46
+ end
47
+
48
+ it "wraps CODE tags around doubled backtick spans with a single literal backtick inside them" do
49
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
50
+ ``There is a literal backtick (`) here.``
51
+ ---
52
+ <p><code>There is a literal backtick (`) here.</code></p>
53
+ ---
54
+ end
55
+
56
+ it "correctly transforms two literal spans in one line" do
57
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
58
+ This `thing` should be `two` spans.
59
+ ---
60
+ <p>This <code>thing</code> should be <code>two</code> spans.</p>
61
+ ---
62
+ end
63
+
64
+ it "correctly transforms literal spans at the beginning of a line" do
65
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
66
+ I should think that the
67
+ `tar` command would be universal.
68
+ ---
69
+ <p>I should think that the
70
+ <code>tar</code> command would be universal.</p>
71
+ ---
72
+ end
73
+
74
+ it "encodes ampersands and angle brackets within code spans as HTML entities" do
75
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
76
+ The left angle-bracket (`&lt;`) can also be written as a decimal-encoded
77
+ (`&#060;`) or hex-encoded (`&#x3c;`) entity. This
78
+ also works with `<div>` elements.
79
+ ---
80
+ <p>The left angle-bracket (<code>&amp;lt;</code>) can also be written as a decimal-encoded
81
+ (<code>&amp;#060;</code>) or hex-encoded (<code>&amp;#x3c;</code>) entity. This
82
+ also works with <code>&lt;div&gt;</code> elements.</p>
83
+ ---
84
+ end
85
+
86
+ # At the beginning of a document (Bug #525)
87
+ it "correctly transforms code spans at the beginning of paragraphs (bug #525)" do
88
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
89
+ `world` views
90
+ ---
91
+ <p><code>world</code> views</p>
92
+ ---
93
+ end
94
+
95
+
96
+
97
+
98
+ ### [Code blocks]
99
+
100
+ # Para plus code block (literal tab, no colon)
101
+ it "wraps sections indented with a literal tab in a code block" do
102
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
103
+ This is a chunk of code
104
+
105
+ some.code > some.other_code
106
+
107
+ Some stuff.
108
+ ---
109
+ <p>This is a chunk of code</p>
110
+
111
+ <pre><code>some.code &gt; some.other_code
112
+ </code></pre>
113
+
114
+ <p>Some stuff.</p>
115
+ ---
116
+ end
117
+
118
+ # Para plus code block (tab-width spaces)
119
+ it "wraps sections indented with at least 4 spaces in a code block" do
120
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
121
+ This is a chunk of code:
122
+
123
+ some.code > some.other_code
124
+
125
+ Some stuff.
126
+ ---
127
+ <p>This is a chunk of code:</p>
128
+
129
+ <pre><code>some.code &gt; some.other_code
130
+ </code></pre>
131
+
132
+ <p>Some stuff.</p>
133
+ ---
134
+ end
135
+
136
+ # Preserve leading whitespace (Bug #541)
137
+ it "removes one level of indentation (and no more) from code blocks" do
138
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
139
+ Examples:
140
+
141
+ # (Waste character because first line is flush left !!!)
142
+ # Example script1
143
+ x = 1
144
+ x += 1
145
+ puts x
146
+
147
+ Some stuff.
148
+ ---
149
+ <p>Examples:</p>
150
+
151
+ <pre><code> # (Waste character because first line is flush left !!!)
152
+ # Example script1
153
+ x = 1
154
+ x += 1
155
+ puts x
156
+ </code></pre>
157
+
158
+ <p>Some stuff.</p>
159
+ ---
160
+ end
161
+
162
+ end
163
+
164
+
@@ -0,0 +1,164 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ BEGIN {
5
+ require 'pathname'
6
+ basedir = Pathname.new( __FILE__ ).dirname.parent.parent
7
+
8
+ libdir = basedir + 'lib'
9
+ extdir = basedir + 'ext'
10
+
11
+ $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
+ $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
+ }
14
+
15
+ require 'spec'
16
+ require 'bluecloth'
17
+
18
+ require 'spec/lib/helpers'
19
+ require 'spec/lib/constants'
20
+ require 'spec/lib/matchers'
21
+
22
+
23
+ #####################################################################
24
+ ### C O N T E X T S
25
+ #####################################################################
26
+
27
+ describe BlueCloth, "emphasis" do
28
+ include BlueCloth::TestConstants,
29
+ BlueCloth::Matchers
30
+
31
+ it "treats single asterisks as indicators of emphasis" do
32
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
33
+ Use *single splats* for emphasis.
34
+ ---
35
+ <p>Use <em>single splats</em> for emphasis.</p>
36
+ ---
37
+ end
38
+
39
+ it "treats single underscores as indicators of emphasis" do
40
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
41
+ Use *underscores* for emphasis.
42
+ ---
43
+ <p>Use <em>underscores</em> for emphasis.</p>
44
+ ---
45
+ end
46
+
47
+ it "treats double asterisks as strong emphasis" do
48
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
49
+ Use **double splats** for more emphasis.
50
+ ---
51
+ <p>Use <strong>double splats</strong> for more emphasis.</p>
52
+ ---
53
+ end
54
+
55
+ it "treats double underscores as strong emphasis" do
56
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
57
+ Use __doubled underscores__ for more emphasis.
58
+ ---
59
+ <p>Use <strong>doubled underscores</strong> for more emphasis.</p>
60
+ ---
61
+ end
62
+
63
+ it "allows you to use both kinds of emphasis in a single span" do
64
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
65
+ Use *single splats* or _single unders_ for normal emphasis.
66
+ ---
67
+ <p>Use <em>single splats</em> or <em>single unders</em> for normal emphasis.</p>
68
+ ---
69
+ end
70
+
71
+ it "allows you to use both kinds of strong emphasis in a single span" do
72
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
73
+ Use _single unders_ for normal emphasis
74
+ or __double them__ for strong emphasis.
75
+ ---
76
+ <p>Use <em>single unders</em> for normal emphasis
77
+ or <strong>double them</strong> for strong emphasis.</p>
78
+ ---
79
+ end
80
+
81
+ it "allows you to include literal asterisks by escaping them" do
82
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
83
+ You can include literal *\\*splats\\** by escaping them.
84
+ ---
85
+ <p>You can include literal <em>*splats*</em> by escaping them.</p>
86
+ ---
87
+ end
88
+
89
+ it "allows two instances of asterisked emphasis on one line" do
90
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
91
+ If there's *two* splatted parts on a *single line* it should still work.
92
+ ---
93
+ <p>If there's <em>two</em> splatted parts on a <em>single line</em> it should still work.</p>
94
+ ---
95
+ end
96
+
97
+ it "allows two instances of double-asterisked emphasis on one line" do
98
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
99
+ This **doubled** one should **work too**.
100
+ ---
101
+ <p>This <strong>doubled</strong> one should <strong>work too</strong>.</p>
102
+ ---
103
+ end
104
+
105
+ it "allows two instances of underscored emphasis on one line" do
106
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
107
+ If there's _two_ underbarred parts on a _single line_ it should still work.
108
+ ---
109
+ <p>If there's <em>two</em> underbarred parts on a <em>single line</em> it should still work.</p>
110
+ ---
111
+ end
112
+
113
+ it "allows two instances of double-underscored emphasis on one line" do
114
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
115
+ This __doubled__ one should __work too__.
116
+ ---
117
+ <p>This <strong>doubled</strong> one should <strong>work too</strong>.</p>
118
+ ---
119
+ end
120
+
121
+ it "correctly emphasizes the first span of the text if it's emphasized with asterisks" do
122
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
123
+ *Something* like this should be bold.
124
+ ---
125
+ <p><em>Something</em> like this should be bold.</p>
126
+ ---
127
+ end
128
+
129
+ it "correctly emphasizes the first span of the text if it's emphasized with underscores" do
130
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
131
+ _Something_ like this should be bold.
132
+ ---
133
+ <p><em>Something</em> like this should be bold.</p>
134
+ ---
135
+ end
136
+
137
+ it "correctly emphasizes the first span of the text if it's emphasized with double asterisks" do
138
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
139
+ **Something** like this should be bold.
140
+ ---
141
+ <p><strong>Something</strong> like this should be bold.</p>
142
+ ---
143
+ end
144
+
145
+ it "correctly emphasizes the first span of the text if it's emphasized with double underscores" do
146
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
147
+ __Something__ like this should be bold.
148
+ ---
149
+ <p><strong>Something</strong> like this should be bold.</p>
150
+ ---
151
+ end
152
+
153
+ # Partial-word emphasis (Bug #568)
154
+ it "correctly emphasizes just a part of a word (bugfix for #568)" do
155
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
156
+ **E**xtended **TURN**
157
+ ---
158
+ <p><strong>E</strong>xtended <strong>TURN</strong></p>
159
+ ---
160
+ end
161
+
162
+ end
163
+
164
+